save-state.php
资源名称:ext-3.1.0.zip [点击查看]
上传用户:dawnssy
上传日期:2022-08-06
资源大小:9345k
文件大小:0k
源码类别:
JavaScript
开发平台:
JavaScript
- <?php
- session_start();
- if(!isset($_SESSION['state'])){
- $_SESSION['state'] = array(
- 'sessionId'=>session_id()
- );
- }
- foreach($_COOKIE as $name=>$value){
- // look for state cookies
- if(strpos($name, 'ys-') === 0){
- // store in session
- $_SESSION['state'][substr($name, 3)] = $value;
- // remove cookie
- setCookie($name, '', time()-10000, '/');
- }
- }