You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
411 B
16 lines
411 B
<?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)] = rawurlencode($value);
|
|
// remove cookie
|
|
setCookie($name, '', time()-10000, '/');
|
|
}
|
|
}
|