JavaScript Editor Javascript validator     Web page editor 



Making a session persistent

Making a session persistent --  This example illustrates how to make a session persist over multiple browser sessions using a so called "session cookie".

Explanation

When you create a session it needs to be referenced using a sessionID. This sessionID is generally saved either into a cookie or passed along in the URI.

To remember the sessionID across browser sessions, the cookie method is favoured.

To extend the lifetime of this cookie (the standard is that it's only valid until the browser is closed) we use PHP's session_set_cookie_params().

Example




JavaScript Editor Javascript validator     Web page editor