qadwjoh has asked for the wisdom of the Perl Monks concerning the following question:

Hi

Is is possible to create a session using CGI::Session and have two different Perl scripts read and update values in it at the same time?

I've two scripts - one runs a program which calls the other script, while the first is still running. The first script sets up a session and then waits until it has been updated with data from the second script.

The second seems to open the session file OK, but calling $session->flush does not update the session file, so the first script is waiting for ever. Is this because it is still in use by the already running first script? Or have I missed something?

Andrew

Replies are listed 'Best First'.
Re: CGI::Session between two scripts
by arden (Curate) on Feb 09, 2004 at 18:29 UTC
    Andrew, without seeing your code (hint hint), we can only speculate. I would wager from your description though, that your first script still has the session file open, preventing the second script from writing to it.
      Do I have to close the session if I want another script to be able to update it? How do I do this?

      Andrew
        $session->close;