[Catalyst] Session::Store (::Memcached?) sharing/wrong user session data

Ric Johnson ric at xymmetrix.com
Fri May 13 22:00:19 GMT 2011


Hi,

I'm new to the list but I've searched the archives of the list and can't find anything even related to this question.

I am using Sessions with Memcached. My config:

Authentication
Authorization::Roles
Authorization::ACL 
Session
Session::State::Cookie
Session::Store::Memcached

Calls to $c->user->get( '<user db field name>' ) [in a Mason template using View::HTML::Mason] return values that are not the ones I should see.

For instance:

I login as 'ric', my $c->user->get( 'first_name' ) should return "Ric"

But I randomly get (depending on which Apache server instance I hit) a first_name associated with some other user's session. So I open 4 browsers and log in as 4 different users.

If I go back to ANY of the 4 browsers (FF, IE, Safari, Chrome) and refresh the page that prints $c->user->get( 'first_name' ) over and over and I get a random sampling of the 4 users logged in and even some empty strings. (Don't know if that's related.) It's clearly showing the info for the first user that logged in under that copy of the Apache web server session.

I've even called $c->user before $c->user->get() [as opposed to $c->user_exists] to be sure to pull user info back from the db--to no avail. 

[Guessing Starts Here]
It seems like when the $c->user data is retrieved, it gets stuck into the memory space of the webserver. Then it never reloads that info from disk or memcached.

I can't even say this is peculiar to ::Memcached because when I was using ::FastMmap, I was having to many other issues with the shared disk file and permissions so I abandoned it for Memcached.

So anything you could do to help would be very . . . helpful. -- King Arthur, Python

Thanks,
Ric




More information about the Catalyst mailing list