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

I'm using CGI::Session 3.95 on a CGI::Application based app running on IIS. Session data is not being stored persistently. I am calling the CGI::Session->new with a valid session identifier, and I am able to store data in the session within one run of the script, but the data doesn't seem to be written to disk. I'm using the MySQL backend and I am calling $session->flush() after inserting data.

Any ideas? After some searching I've seen that it might have something to do with the call to flush() being in a package rather than in a script.

--TWH

Replies are listed 'Best First'.
Re: CGI::Session not keeping data
by Jaap (Curate) on Jul 21, 2004 at 07:34 UTC
    Did you check to see if the MySQL database is storing the session information? Do some manual selects to check.
      Problem solved. Somehow during a recent upgrade to MySQL (I think) either the behavior of REPLACE INTO changed or the id column in my session table lost its UNIQUE status. Each call to $session->param() was adding a new row to the table. After making the id column a UNIQUE index everything started working properly again.

      --TWH