Im using CGI::Session
to store session data from CGI::Application
(specifically i'm using CGI::Session
through the CGI::Application::Plugin::Session
module).
In one of my application modes I do this:
my $self = shift;
# Get CGI query object
my $q = $self->query();
$self->session->save_param($q);
To save my parameters to the session data however on retrieving them using $self->session->param('user')
I find that only the user parameter contains any data even though other parameters are being sent server side and are accessible through $q->param()
the user parameter retrieved from the session is an array of the parameters, however i would expect that $self->session->param('user')
would return a single string with the contents of the parameter 'user'.
Is this behavior expected?
If so why?
I'm not sure I understand exactly what you mean, but this looks weird. You're not doing what the CGI::Session doc says you should. You can't just save the CGI object. You need to store each param individually.
If you want to just store all the CGI params in your Session, do it like this:
Or you might even do it like this for all of them: