Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #4214

Re: sessions timeout

From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.php
Subject Re: sessions timeout
Date 2012-01-04 09:20 +0100
Organization A noiseless patient Spider
Message-ID <4F040BE5.7000207@arnowelzel.de> (permalink)
References <66b7g7lk434p6vk68429d8np5134jd52hd@4ax.com>

Show all headers | View raw


Michael Joel, 2012-01-04 02:42:

> I am on a shared server so I have no control over the settings.
> 
> Is there a way for me to set a "timeout" for sessions?

Maybe using ini_set() to modify session.cookie_lifetime - but i'm not
sure if this is possible.

Another way would be to manage this "manually" - e.g. using the current
time and the time of the last activity of the user:

1) When the session is created also store the current time as a session
variable.

2) If there is already a session compare the current time with the time
recorded in the session and then either destroy the session, if the time
span is too long OR update the time in the session.

> I am working on some scripts (logged in as a test user) and had been
> away from it for a few hours. The tabs (this is Opera browser) were
> closed, but not the browser.
> 
> When I went back to the page it still had me logged in.

Sure - the cookie is still there as long as the browser is running.

> Obviously the server session cookies are set to clear when the browser
> closes.
> 
> Is there a way for me to have some control over this and set a time
> limit so after a reasonable amount of time the session cookie clears?

See above.


-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

sessions timeout Michael Joel <no@please.com> - 2012-01-03 20:42 -0500
  Re: sessions timeout gordonb.bqidf@burditt.org (Gordon Burditt) - 2012-01-03 22:23 -0600
  Re: sessions timeout Arno Welzel <usenet@arnowelzel.de> - 2012-01-04 09:20 +0100
    Re: sessions timeout The Natural Philosopher <tnp@invalid.invalid> - 2012-01-04 10:51 +0000
      Re: sessions timeout Arno Welzel <usenet@arnowelzel.de> - 2012-01-08 20:17 +0100
  Re: sessions timeout Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-04 06:54 -0500

csiph-web