Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: CGI::Session in modperl data is inconsistent

by Anonymous Monk
on May 19, 2012 at 06:35 UTC ( #971397=note: print w/ replies, xml ) Need Help??

Comment on Re: CGI::Session in modperl data is inconsistent
Re^2: CGI::Session in modperl data is inconsistent
by Anonymous Monk on May 20, 2012 at 04:02 UTC
Re^2: CGI::Session in modperl data is inconsistent
by keenlearner (Acolyte) on May 26, 2012 at 15:18 UTC
    thanks, I have read some of those article, still I cant find the cause of my bug.

      You don't show any code, so we can't reproduce or diagnose your problem. Please post a short, self-contained example that reproduces the problem.

      Maybe you don't use a backend for CGI::Session that works across mod_perl instances, or you don't save the values into the session when you think it does, or you don't retrieve the values from the session when you think you do.

        Hi, yeah I am aware of the problem of not showing the code but my code is just too big and libraries in multiple file calling each other which make it impossible to summarize the code. So I have to go this way.

        But finally I have found the cause. After update the session I have to undef($session) to destroy the session from memory instead of $session->flush() , because calling flush function only write data from memory to file and does not destroy the $session from cache MEMORY, when call CGI::Session->load($sessionId) with another child process, it will load the session that is still cache in memory by modperl that have the old value. So the one that's not updated will overwrite the session db file with the old value.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://971397]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2014-12-28 23:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls