save-state.php
资源名称:ext-3.0.0.zip [点击查看]
上传用户:shuoshiled
上传日期:2018-01-28
资源大小:10124k
文件大小:0k
源码类别:
中间件编程
开发平台:
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, '/');
- }
- }