perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Perrin Harkins" <>
Subject Re: Saving Session State
Date Wed, 06 Feb 2008 21:28:24 GMT
On Feb 6, 2008 3:59 PM, brett lee <> wrote:
> 1.  First problem is that refreshing the screen often (not always) results in a new session
being generated:
> With these failures, I can see the browser session in the filesystem, its not expired,
but it is not picked up with load().

That doesn't sound like the bug you linked to.  Check that your code
is getting the right session ID from cookies or however you do it in
your app.

> 2.  Other one is that I see new session ID's in the browser but not always on the server

This also doesn't sound related to the bug you're linking to.  Most
likely this means you have a scoping problem in your code that
prevents the session object from going out of scope.  You can either
fix the scoping issue or call flush().

> Am using's  function-oriented style so I don't have a CGI object.  The 4.10 doc
for CGI::Session 4.10 shows saving params without an object, but when I try I get an error
indicating the first arg has to be an object.  So, am using the following:
> my $session = CGI::Session->load(undef, undef, {Directory=>'/tmp/sessions'});

You are passing undef as your session ID.  This will never load
anything.  What's the problem with passing your real ID?

> Also, the 4.10 doc writes:
> $session = new CGI::Session(undef, undef, {Directory=>'../tmp/sessions'});
> I've tried "../tmp/sessions" and "/tmp/sessions".  Have never seen anything in "../tmp/sessions"
(relative to "/cgi-bin" or DOC ROOT) but I do see sessions (sometimes) appear in "/tmp/sessions".
 Happen to know if the syntax is relative (../), or absolute (/)?

I never use file-based sessions.  I suggest using a database.  It's a
lot more common and thus better tested.

- Perrin

View raw message