NYCPHP Meetup

NYPHP.org

[nycphp-talk] preventing randomized session variable from changing when page is refreshed

Ajai Khattri ajai at bitblit.net
Thu Aug 21 09:07:52 EDT 2008


On Wed, 20 Aug 2008, Kristina Anderson wrote:

> I've got everything going into the database in a table whose structure 
> is prodID, sessionID fields in each row, so they can add an unlimited 
> amount of stuff.  I just have to guard against that sessionID changing 
> because it will wipe out their cart.  If that explains it better.

Sure, but most people reading this are shaking their heads because the PHP 
session functions handle sessions IDs for you, no need to generate this 
yourself. The session ID should be stored in a cookie and the cookie needs 
to be checked for in every page. PHP's session functions do that for you.

http://us3.php.net/manual/en/book.session.php


-- 
Aj.




More information about the talk mailing list