in reply to Session problem

A browser doesn't know about perl, and browser quirks are just quirks.

Replies are listed 'Best First'.
Re^2: Session problem
by priti (Initiate) on Aug 08, 2008 at 07:01 UTC
    But why the behavior is different ??? I have problem in session delete i suppose.If session is destroyed then how come all the fields are there in cgises_ in /tmp folder .... to delete session i am using : $session->delete(); method....do we have destroy which completely destroy session in perl... i feel i am messing something.If in php you write session_destroy() the $_SESSION is empty .....but in perl how it works !!! how to check the old session is lost ?

      The problem is probably with browser caching and POST v GET handling on form submissions. You generally want to redirect POSTs to GETs after you handle them. Without some sample code I'm just guessing, though. There is more than one Perl session package. A thorough understanding of HTTP plus browser quirks in regards to caching and HTTP method handling is necessary to debug this stuff.

      The PHP session is not a terrific example of how it should work. The session data proper is emptied but the session, its cookie, and the globals it might have set-up are alive and well and can lead to all kinds of problems if you don't sanitize/check it (and take care of your own persistence layer if you actually have one) and clear the cookie. Very annoying default behavior. From the docs-

      session_destroy() destroys all of the data associated with the current session. It does not unset any of the global variables associated with the session, or unset the session cookie.