[Pmwiki-users] PmWikiDraw uploads problem

Patrick R. Michaud pmichaud
Tue Dec 14 07:00:39 CST 2004

On Tue, Dec 14, 2004 at 12:20:32PM +0000, Ciaran wrote:
> As to how long a session lasts, thats usually configuration dependant.
>  Opening a 'new ' browser (ideally a different one, i.e
> InternetExplorer rather than firefox) will give you a new session.  To
> close all sessions, if you can, just restart the web server.  I
> *think* that will kill all sessions in most cases...I'm not sure if
> some are clever enough to persist between restart however :)

Actually, restarting the webserver has absolutely no impact on sessions--
sessions are managed entirely by PHP through the filesystem.  Ending a
session occurs when either (1) the file containing
the session data is removed from the server (this happens automatically
after ~24 minutes of inactivity), or (2) the browser "forgets" or otherwise
stops sending the cookie used to identify the session.

For those who are interested in the technical details, here is how
sessions work...

1. When a session is started, PHP generates a unique "session id" and
returns it in a cookie to the browser.  PHP also generates a file
on the webserver that keeps track of all of the session's stored 

2. The browser receives the cookie from PHP and stores it in the list
of cookies to be sent to the site.  On each subsequent request to the
server, the browser sends the cookie containing the session id as part
of the request.  PHP is able to use the cookie value to locate the
session file on the server filesystem and restore the session variables.

3. PHP can explicitly remove the session variables by calling
session_destroy(), or the session can be destroyed automatically by PHP
if it's been more than 24 minutes since the last access to the 
session file.  (It doesn't happen exactly at 24 minutes -- random
executions of PHP choose to do "session cleanup" and remove any session
files that have not been accessed within 24 minutes.)


More information about the pmwiki-users mailing list