Notes on session_start in PHP7!
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 ]);
$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)); } }
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!

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

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)
