Sessions for anonymous users

Events happening in the community are now at Drupal community events on www.drupal.org.
mossy2100's picture

Hi all

I am having some difficulty with the site at http://iwda.asia. It seems sessions aren't being initialised/started/created for anonymous users, which means when someone registers on the site the message they should see, such as "You have been sent an email", etc., doesn't appear, because those messages are stored in the session.

I have spent a fair bit of time on this. Apparently this problem can sometimes be cause by user 0 having been deleted from the users table, however, that is not the case with me. For whatever reason there is no session being created for anon users. I can't seem to track down the cause, even after trawling through a considerable amount of core code.

If anyone can help with this I will be grateful.

Thanks,
Shaun

Comments

There are many things that

gordon's picture

There are many things that can cause this.

Are you using pressflow instead of Drupal?
Are you using varnish or another reverse proxy?
Are you using memcache session handling, or another session handler?

Gordon.

--
Gordon Heydon

no

mossy2100's picture

No
No
No

:)

This is an ordinary Drupal installation on a shared host.
I have been investigating the session id and I can see that a new session is created on every page load for anon users.

Drupal 7 == bits o' Pressflow

MrKistic's picture

You're using Drupal 7 though aren't you? Hasn't that taken on some of Pressflow's session management functionality? Pressflow is pretty aggressive about not giving out sessions for anonymous users.

I get messages when I

sime's picture

I get messages when I register or try to login with bad user/pass. Is it a problem at your browser end? (or maybe you fixed it...)

workaround

mossy2100's picture

No, I did something you wouldn't approve of, namely, coded a workaround. I save the session and reload it myself, using a hash of the IP address as a session id. I will have to figure it out at some point, but having spent many hours trying to solve the problem, this was a way to get the site working.

As self-appointed god of

sime's picture

As self-appointed god of practical work-arounds, I approve of all. Hope you find the cause!

I don't know if this helps,

dgtlmoon's picture

I don't know if this helps, but, There's a bunch of settings in PHP for managing your sessions, paste us your phpinfo() output so we can compare

./php -i|grep -i ^session

(Assuming your CLI is same config as your server side)

Session Support => enabled
session.auto_start => Off => Off
session.bug_compat_42 => Off => Off
session.bug_compat_warn => On => On
session.cache_expire => 180 => 180
session.cache_limiter => nocache => nocache
session.cookie_domain => no value => no value
session.cookie_httponly => Off => Off
session.cookie_lifetime => 0 => 0
session.cookie_path => / => /
session.cookie_secure => Off => Off
session.entropy_file => no value => no value
session.entropy_length => 0 => 0
session.gc_divisor => 1000 => 1000
session.gc_maxlifetime => 1440 => 1440
session.gc_probability => 1 => 1
session.hash_bits_per_character => 5 => 5
session.hash_function => 0 => 0
session.name => PHPSESSID => PHPSESSID
session.referer_check => no value => no value
session.save_handler => files => files
session.save_path => no value => no value
session.serialize_handler => php => php
session.use_cookies => On => On
session.use_only_cookies => On => On
session.use_trans_sid => 0 => 0

Australia

Group categories

Location

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: