Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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 ?

  • 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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://971387]
Approved by naikonta
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2018-01-20 09:48 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (226 votes). Check out past polls.