make sure the README will appear on github
[extjs.git] / examples / state / save-state.php
1 <?\r
2 session_start();\r
3 if(!isset($_SESSION['state'])){\r
4     $_SESSION['state'] = array(\r
5         'sessionId'=>session_id()\r
6     );\r
7 }\r
8 foreach($_COOKIE as $name=>$value){\r
9     // look for state cookies\r
10     if(strpos($name, 'ys-') === 0){\r
11         // store in session\r
12         $_SESSION['state'][substr($name, 3)] = $value;\r
13         // remove cookie\r
14         setCookie($name, '', time()-10000, '/');\r
15     }\r
16 }\r
17 ?>