View Single Post
Old 08-19-2008, 08:34 PM   #1 (permalink)
shownomercy
The Visitor
 
Join Date: Feb 2008
Posts: 4
Thanks: 0
shownomercy is on a distinguished road
Default Storing Session data in $_COOKIE as well

I have been struggling for a while on how to share information stored in $_SESSION in order to avoid pop up issues with IE and etc. I would really like some insight into how to deal more gracefully with cookies, from someone who uses them more often than i.

Basically all I want to do is populate the session data into the cookie. Here is an example of code that would be nice to work:


PHP Code:
$userid $_SESSION['userid'];
$username $_SESSION['username'];
$password $_SESSION['password'];
$userlevel $_SESSION['userlevel'];

setcookie("uservars['userid']"$userid);    
setcookie("uservars['username']"$username);    
setcookie("uservars['password']"$password);    
setcookie("uservars['userlevel']"$userlevel); 
For whatever reason, setting the cookies on the same script the session is being set from POST is not working properly either ... but I would be happy to employ another similar method.

The only cookie that is working is the one to identify the session ... erg
shownomercy is offline  
Reply With Quote