Session variable is lost when not logged in – Drupal


Hello Everyone!

I have a module in Drupal 6 that saves some information in the $_SESSION array. I use this information to customize some content in another page.The problem is that when I’m not logged in Drupal, the information is not saved in the session. When I’m logged in, it works as expected.

After a lots off hard work about this issue i just figured out what was causing the problem. In order to access session data for anonymous users the ‘Users’ table in the drupal database must contain a user with uid = 0. I found that in my database somehow the user entry with uid = 0 got modified and that is what was causing the problem.

 

Enjoy Code! | Enjoy Raghunath Blog

Advertisements

Sr. Software Engineer

Tagged with: , , , ,
Posted in Drupal
4 comments on “Session variable is lost when not logged in – Drupal
  1. medical says:

    Great go through! This article is detailed and pinpoint to each essential part of the subject matter.

  2. Good way of telling, and pleasant post to get facts concerning
    my presentation subject matter, which i am going to deliver in college.

  3. Thank you for every other great article. Where else could
    anyone get that type of information in such a perfect approach of writing?
    I have a presentation next week, and I’m on the search for
    such information.

  4. mikki says:

    Touche. Outstanding Blog. Keep up the amazing effort.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: