RE: [Cgi-session-user] Session not saving data files
Brought to you by:
sherzodr
From: K.G. W. <kg...@se...> - 2005-09-07 21:50:24
|
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...]=20 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 =3D $query->cookie("MySesId") || undef; > $session =3D new CGI::Session(undef, $sid, > {Directory=3D>"$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.=20 I suspect this would work for you:=20 # Braces establish scope { $sid =3D $query->cookie("MySesId") || undef; $session =3D new CGI::Session(undef, $sid, {Directory=3D>"$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?=20 Mark |