RE: [PHP] session experation

From: Warren Vail (Warren.Vail_at_bankofamerica.com)
Date: 10/10/03


Date: Thu, 09 Oct 2003 15:30:09 -0700
To: Daniel Guerrier <dan_guerrier@yahoo.com>, php-general@lists.php.net

Sam,

There is a way to keep a session active beyond the death of the browser, but the odds are that this will not do exactly what you want either, since killing the session on browser close is the customary setting.

In my case I expected closing the browser to kill the session (or more correctly cause the browser to drop the cookie for the session ID). php.ini parameter session.cookie_lifetime was set to a value other than zero, and my sessions remained active even after the browser was closed (probably had other things going on as well), so that opening a new browser picked up the same session key (not too cool for my app) ;-).

I'm not sure you want to deal with other aspects of this, like manually opening a new browser and using the session key (same cookie) of a browser already open? Just be careful.

Warren Vail

-----Original Message-----
From: Daniel Guerrier [mailto:dan_guerrier@yahoo.com]
Sent: Thursday, October 09, 2003 1:23 PM
To: php-general@lists.php.net
Subject: Re: [PHP] session experation

The session will die on browser close. What you are
asking for is how to use cookies.
You can set a cookie and use the information in that
to determine user functionality

http://us2.php.net/manual/en/function.setcookie.php

--- Sam Folk-Williams <sfolkwilliams@mn.rr.com> wrote:
> Hi,
>
> I want to extend the length of a session based on
> the existance of a
> variable beyond the closing of the browser.
> Basically, I've got a restricted
> intranet where staff have to log-in and I want to
> add a "remember me"
> option. If they check off the remember me box, then
> the session will be set
> to expire in one year instead of as soon as the
> browser closes. Is there a
> way to do this without altering the php.ini file?
> (I'm in a shared hosting
> env and don't think I can alter that file).
>
> Or, is there a better way to acheive this result?
>
> Thanks,
>
> Sam
>
> --
> Sam Folk-Williams
> Service Team Leader/Webmaster
> Rise, Inc -- Creative Partnerships South
> (952) 884 8330 (V); (952) 884 8371 (F)
> www.rise.org
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Relevant Pages

  • Re: _SESSION weirdness behind a NAT firewall/router: bug?
    ... that the 'sess_deleted' file is actually being used as a session ID. ... force the cookie to expire. ... Any $_SESSION values introduced by one browser become part of the ... I re-load the non-logged-in index page in Opera. ...
    (comp.lang.php)
  • Re: Is Session Always Cleared?
    ... If the first user closes his browser after he is finished, the session cookie is forgotten. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Detecting loss of session
    ... > a request. ... From what I've read on session cookies ... > sending) them as soon as they expire, not when the browser is closed? ... If you don't set the expiration on a Cookie, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Cookies , Session Which is Better ? and Global.asa Question
    ... YOU SHOULD NEVER STORE PERSONALLY IDENTIFIABLE INFORMATION IN A ... If you needed to store personal information in a cookie use non ... impossible - its much harder for me to hijack session information from ... The average time a session lasts is 20 mins. So, when your browser ...
    (microsoft.public.inetserver.asp.general)
  • Re: ASP sessionstate
    ... ASP doesn't know or care what browser it ... ticket number given when the first item is added to the cart. ... How can a Response.Write write to the server screen? ... :> delete the cart file and set the session ...
    (microsoft.public.inetserver.asp.general)