good chemistry is complicated,
and a little bit messy -LW
Re: having problems w/CGI-Sessionby MrCromeDome (Deacon)
|on May 20, 2005 at 21:06 UTC
I'm torn between downvoting you for a poorly-asked question and running away screaming, but as tcf03 already chastized you I'll refrain from further. Your question seems to contradict itself, so I'll try to answer your question as best as I understand it.
When you say "Seems a new session file is created w/Netscape but not w/Apache", do you mean that every time a browser makes a request a new session file is created? That's the only thing I can guess that makes sense. If that's the case, you're likely not re-initializing an existing session.
Take a look at the following:
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.
I'm guessing your code may look more like this:
but as I can't see your code I am wildly speculating. The second undef in this case is always creating a new session.
One other thing I can think of is this:
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.
Keep in mind that this is untested as I don't have an iPlanet server to beat on. And I don't know why it behaves differently on the two.
Yes, it's Friday, and I'm grumpy and I want to go home.