$session = CGI::Session->load() or die CGI::Session->errstr;
if ( $session->is_expired ) {
die "Your session expired. Please refresh your browser to re-start your session";
}
if ( $session->is_empty ) {
$session = $session->new();
}
print $session->header();
#save into session
$session->param('username',$username);
#read from session
$variable = $session->param('username');
No comments:
Post a Comment