Re: [Cgi-session-user] CGI::Sesion works incorrectly
Brought to you by:
sherzodr
From: Sergey B. <si...@gm...> - 2006-07-23 11:15:53
|
I've changed my code in agree to your code, it doesn't work. I think that problem, probably, in initializing session instance. It initializes in two steps: creating session instance and then reinitializing session (reading CGISESSID and creating session file). It seems that my getInstance() method returns "half-initialized" session object. I mean to use condition "defined $session" is not enough. getInstance() should initialize sesssion, reinitialize and only after that returns instance. Is any ideas how to change condition (defined $session) to condition which will check if sesion object "full-initialized" ? > On 7/21/06, Sergey Brutsky <si...@gm...> wrote: > >> sub getInstance >> { >> defined $session or $session = CGI::Session->new( undef, undef, { Directory => "/tmp/session" } ); >> return $session; >> > > *snip* > > >> my $session = SessionSingleton->getInstance(); >> > > The definition of getInstance looks to be incorrect. It should look > something more like: > sub getInstance { > defined $session ? $session : ($session = CGI::Session->new( > undef, undef { Directory => "/tmp/session" })) > } > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Cgi-session-user mailing list > Cgi...@li... > https://lists.sourceforge.net/lists/listinfo/cgi-session-user > > |