Hi, I'm writing a cgi application that exploits cgi::session, but it seems as I'm unable to overwrite some parameters. Consider the following code:
sub clearSession{ # get local parameters my ($_cgi_, @_toDelete_) = @_; my ($_sessionID,$_session,$_username_,$_config_,$_permissions_, $_original_root_); my ($_page_,$_current_page_,$_tmp_); # get the current session my $_sessionID = $_cgi_->cookie('CGISESSID') || $_cgi_->param('CGISESSID') || undef(); my $_session = new CGI::Session( undef(), $_sessionID, {Directory => '/tmp'} ); $_page_ = $_session->param($_PAGE_KEY_); $_current_page_ = $_cgi_->url(-relative=>1); # is the user on the same page? if( $_page_ ne $_current_page_ || ! $_page_){ # the page has changed $_username_ = $_session->param($_USERNAME_KEY_); $_config_ = $_session->param($_CONFIG_KEY_); $_config_ = $_session->param($_CONFIG_KEY_); $_permissions_ = $_session->param($_PERMISSIONS_KEY_); $_original_root_ = $_session->param($_ORIGINAL_ROOT_KEY_); print FILE "\nentrato!\n"; $_session->clear(); $_session->param(-name => $_USERNAME_KEY_, -value => $_username_); $_session->param(-name => $_CONFIG_KEY_, -value => $_config_); $_session->param(-name => $_PERMISSIONS_KEY_, -value => $_permissions_); $_session->param(-name => $_ORIGINAL_ROOT_KEY_, -value => $_original_root_); $_session->param(-name => $_PAGE_KEY_, -value => $_current_page_); $_session->flush(); } elsif( not $_page_ ){ # the page is not yet defined $_page_ = $_current_page_; $_session->param(-name => $_PAGE_KEY_,-value => $_current_page_); } } I'd like to call this function on each page of my program, in order to clean the session from dirty data when the user changes the page. However, even if I'm able to write and change a few parameters, and I'm sure that the subroutine does the first if, the $_PAGE_KEY_ variable is never changed from its initial value. I'm sure $_current_page changes, because I print the same value on the page, thus I can see it changing, but the value in the session never changes. Any idea? Thanks, Luca -- Luca Ferrari, [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>