TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 08-19-2008, 08:34 PM   #1 (permalink)
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
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:21 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design