in reply to having problems w/CGI-Session
This creates a new session object in your code. The first argument declares some things about your session, namely where it is stored and how it is stored. Declaring it as undef will invoke its default behavior, which is ok in this case.. The second argument, $request, is the likely key to this mystery. $request is a CGI object that was declared elsewhere in my code. CGI::Session is going to try to get the existing session ID out of that CGI request object. It may have been passed in the query string, or it might have been passed in the cookie, or as a hidden form field. If CGI::Session can't find that session ID, it will automatically create a new session. The last argument is used for passing configuration arguments to CGI::Session. In this case, we're telling it what directory to put the session files into.my $session = new CGI::Session(undef, $request, { Directory => "/tmp" +});
but as I can't see your code I am wildly speculating. The second undef in this case is always creating a new session.my $session = new CGI::Session(undef, undef, { Directory => "/tmp" });
Where $sid is the id of the session you wish to recreate. If you're using this form, then whatever you are using to populate $sid is failing. Chances are you'd be better off with my initial option.my $session = new CGI::Session(undef, $sid, { Directory => "/tmp" });
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: having problems w/CGI-Session
by ww (Archbishop) on May 21, 2005 at 02:12 UTC | |
by MrCromeDome (Deacon) on May 21, 2005 at 07:57 UTC | |
by aroc725 (Acolyte) on May 24, 2005 at 13:08 UTC | |
by MrCromeDome (Deacon) on May 25, 2005 at 02:44 UTC | |
by Anonymous Monk on May 21, 2005 at 07:45 UTC |