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