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

Replies are listed 'Best First'.
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.