McDanger All American 18835 Posts user info edit post |
Alright, here's my problem --
I try to use CGI::Session->load($cgi) to grab a session I've already created in a different page. Basically, I have a login page that upon a successful login will create a session and bake a cookie like so:
$session = new CGI::Session(undef, undef, {Directory=>'/tmp'}); print $session->header();
This writes a new file to /tmp to keep track of the session. I can see these files being created, they're all named cgisess_* (where * is the session id). They all have lrwx permissions across the board (anybody can open them to dink around).
Now here's my problem -- I have a little test page which tries to pull the cookie from the user and grab the session from disk. $session = CGI::Session->load($cgi);
When I pull the cookie out like so manually: $session_id = $cgi->cookie('CGISESSID');
it gives me the same session_id that I sent back to the browser (my login page prints this to screen so I could verify it).
So now I'm sitting here staring at the file on disk which has cgisess_<the session id i'm looking at> and CGI::Session->load($cgi) still gives me back a blank session.
Any ideas why the fuck it won't find the session in /tmp and load it properly? Any advice would be appreciated. 9/9/2005 11:05:58 AM |
lilbirdey Starting Lineup 55 Posts user info edit post |
You explicitly delcared /tmp as your directory when you wrote the session. Perhaps it will help to do so when you load it as well:
$session = CGI::Session->load(undef, $cgi, {Directory=>'/tmp'});
That's the only thing that looks obvious to me. 9/9/2005 7:08:08 PM |