sudeepg
Feb 03, 2010

Drupal has a custom session handler that allows for handling of standard PHP session $_SESSION['key'] = 'value' for anonymous and autheticated users as well.

 

This session declared as above would persist from page to page. So, the above trick is helpful and you would not have to resort to cookies to store some information that stays from page to page (like when implementing multi-step form).

 

Sometimes, the standard $_SESSION may not work? Why?

 

Check out your users table. User table with uid 0 may be missing. Drupal uses this user with uid 0 for handling sessions for anonymous users. This comes by default, so if you lost it, please put it back again.

 

 

Post new Comment

  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.