$id = $query->cookie(-name=>"SESSID"); eval { tie %session, 'Apache::Session::File', $id, { Directory => "$cartInfoPath", LockDirectory => "$cartInfoPath"}; }; if ($@) { if ($@ =~ /^Object does not exist in the data store/) { $id = undef; tie %session, 'Apache::Session::File', $id, { Directory => "$cartInfoPath", LockDirectory => "$cartInfoPath"}; } } if ($id == undef) { $cookie = $query->cookie( -name=>'SESSID', -value=>$session{_session_id}, -expires=>'+1y', -path=>'/'); print $query->header(-cookie=>$cookie); print "Assigned session ID ".$session{_session_id}."<br>\n"; } else { print $query->header(); print "Not assigned session ID already ".$session{_session_id}." < +br>n"; }
Edit by dws to fix formatting and add <code> tags
In reply to Apache Session problem by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |