Re: [Cgi-session-user] V 4.03: Problem with load(), delete() and flush()
Brought to you by:
sherzodr
From: Mark S. <ma...@su...> - 2006-01-12 14:35:19
|
Thanks for the report Ron. Some comments below. > my($id); > my($session); > > { > $session = CGI::Session -> new(); > $id = $session -> id(); > > print "Inner scope. New session: $session. id: $id. \n"; > } > > print "Original scope. id: $id. \n"; > > $session = CGI::Session -> load($id); > > print "Original scope. Old session: $session. id: ", $session -> id(), ". \n"; > > if ($session -> is_empty() ) > { > print "Original scope. Empty. \n"; > > $session -> delete(); > } Just to be clear here, there is only one "$session" here in one scope, the global scope. Therefore, it probably never goes out of scope, requiring an explicit flush. While using "{" and "}" does create a smaller scope, variables don't exist solely within that scope unless you create them there with "my". Mark |