[development] Sessions and non-logged-in users

Khalid B kb at 2bits.com
Tue May 16 22:01:35 UTC 2006


> * and then Khalid B declared....
> > Use session data.
> >
> > To store something use:
> >
> > $_SESSION['foo'] = $bar;
> >
> > To get it back use:
> >
> > $baz = $_SESSION['foo'];
> >
> > That is it.
>
> Thanks.
>
> Will the data not be lost when the browser is closed?

No.

Session data are stored in drupal's sessions table, and
cross referenced with an SID that  is stored in the PHPSESSID
cookie on the user's machine.

So, the data will be lost if that PHPSESSID cookie for the site
is deleted.


More information about the development mailing list