Notes on session_start in PHP7!
session_start
PHP7 Notes on session_start will cause the browser page not to update
Related recommendations: " php session session (topic)》
Please see the code
//PHP7中session_start 使用注意事项, session_start([ 'cache_limiter' => 'private', //在读取完毕会话数据之后马上关闭会话存储文件//启用后,浏览器刷新时,页面将不再请求服务器刷新,只能使用CTRL+F5刷新才重新请求数据,慎用! 'cookie_lifetime' => 3600 , //SessionID在客户端Cookie储存的时间,默认是0,代表浏览器一关闭SessionID就作废 'read_and_close' => true //在读取完会话数据之后, 立即关闭会话存储文件,不做任何修改//启用后不能修改,不能销毁SESSION ]);
Copy after login
$tmd = $_GET['tmd'] ?? 1; refreshUrl("admin_login.php",$tmd); /*浏览器刷新时,更新URL地址,防止页面缓存*/ function refreshUrl($url, $tmd) { $waitTime = microtime(true) - $tmd; if ($waitTime > 1) { jmpUrl($url); die(); } } /*url跳转加随机数,防止页面缓存*/ function jmpUrl($url) { if (!strpos($url, '?')) { header("Refresh:0;url=" . $url . "?tmd=" . microtime(true)); } else { header("Refresh:0;url=" . $url . "&tmd=" . microtime(true)); } }
Copy after login
Related topic recommendations:php session (including pictures Text, video, case)
The above is the detailed content of Notes on session_start in PHP7!. For more information, please follow other related articles on the PHP Chinese website!
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago
By 尊渡假赌尊渡假赌尊渡假赌
Assassin's Creed Shadows: Seashell Riddle Solution
2 weeks ago
By DDD
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months ago
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics
CakePHP Tutorial
1378
52

