RE: [Cgi-session-user] Session not saving data files
Brought to you by:
sherzodr
From: Sherzod R. <she...@ha...> - 2005-09-08 00:25:09
|
Directories are created at driver's init() stage, but sessions are written at session's DESTROY() stage. Could you try adding: $session->flush(); at the end of your program and see if that changes anything? Some errors generated during DESTROY() may not be noticed in the interface of your program, but in your server's error logs. Check them. Are you running under mod_perl or similar environment? If so, failing to declare variables without my() creates global variables, that do not get destroyed within the scope of your program. In this case calling flush() is the only way to make sessions persist (or declaring them with my()). Are your programs running as a designated user? Try to "su" to that user, "cd" into the directory where you're expecting sessions written into, and try to "touch": % touch works-fine Please let us know about your findings. -- Sherzod Ruzmetov > -----Original Message----- > From: cgi...@li... > [mailto:cgi...@li...] On > Behalf Of K.G. Woltz > Sent: Wednesday, September 07, 2005 5:49 PM > To: cgi...@li... > Subject: RE: [Cgi-session-user] Session not saving data files > Importance: High > > > Mark, > Yes it was working before the UNIX server was rebuilt. > The files were written to the dir specified. > I don't know when, during or after, it doesn't matter to the script. > The files need to be there for the next call to the CGI. > > - > KG > -----Original Message----- > From: Mark Stosberg [mailto:ma...@su...] > Sent: Wednesday, September 07, 2005 4:48 PM > To: K.G. Woltz > Cc: cgi...@li... > Subject: Re: [Cgi-session-user] Session not saving data files > > On Wed, Sep 07, 2005 at 04:00:38PM -0400, K.G. Woltz wrote: > > I was using CGI::Session 3.95 last week and the UNIX(Sun Solaris) > folks > > rolled out a new server and installed CGI::Session 4.02. > > Also the Perl version was 5.8.2 and now it's 5.6.1. > > Now when I use my CGI app the session data isn't saving in the dir I > > told it to. > > I tried removing the dir and the app rebuilds the dir but no data > files. > > Anyone know why I'm not saving the data? > > Here is my Perl: > > > > $sid = $query->cookie("MySesId") || undef; > > $session = new CGI::Session(undef, $sid, > > {Directory=>"$server_path/cgi-bin/session/"}) or die > > CGI::Session->errstr; > > KG, > > I'm sorry we broke NASA. > > I think I understand the issue, but I would like opinions from other > developers about what do about it. > > Files are written when the session is explicitly flushed or closed, or > automatically when the object goes out of scope. > > In your example, I'm not sure either happens before the end of the > script. > > I suspect this would work for you: > > # Braces establish scope > { > $sid = $query->cookie("MySesId") || undef; > $session = new CGI::Session(undef, $sid, > {Directory=>"$server_path/cgi-bin/session/"}) or die > CGI::Session->errstr; > } > > Are you saying your application broke after the upgrade, because > CGI::Session 3.95 was automatically flushing your session to disk with > your > example code, but 4.02 isn't? > > Mark > > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development > Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * > Testing & QA > Security * Process Improvement & Measurement * > http://www.sqe.com/bsce5sf > _______________________________________________ > Cgi-session-user mailing list > Cgi...@li... > https://lists.sourceforge.net/lists/listinfo/cgi-session-user > > |