Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

CGI::Session in modperl data is inconsistent

by keenlearner (Acolyte)
on May 19, 2012 at 05:20 UTC ( #971387=perlquestion: print w/ replies, xml ) Need Help??
keenlearner has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I been trying to debug my code for a while. Basically, the code process are :
- create CGI::Session->new
- store value into the session
- retrieve the value from session with the session id from cookie sent by browser with CGI::Session->load($id)
- update the session value
- after update, retrieve session again with CGI::Session->load($id)
- the value returned is new value, but when reload again it becomes old value, and change alternatively with every reload
- I have also called $session->flush() function everytime when I update the session value.


I aware that apache is using different child process, but isn't that the CGI::Session value is stored into the file and retrieve from the file ? which already been shared by child processes. Or the CGI::Session retrieve from its memory which is different among the child ? How can I force the CGI::Session to retrieve from the file instead of memory ? Or how to solve this ?

Thanks

Comment on CGI::Session in modperl data is inconsistent
Re: CGI::Session in modperl data is inconsistent
by Anonymous Monk on May 19, 2012 at 06:35 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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (16)
As of 2014-08-22 19:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (163 votes), past polls