Click here to get back home

Session problem

 HomeNewsGroups | Search | About
 comp.lang.php    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Session problem David Gillen 06-24-2008
Get Chitika Premium
Posted by David Gillen on June 24, 2008, 11:47 am
Please log in for more thread options
Hi.

I've 2 requirements
- session will end when browser is closed
- session will end after 90 minutes inactivity.

Now, from the documentation session.cookie-lifetime when set to 0 _should_
cause the session to end when the browser is closed, although at the moment
this doesn't appear to be the case for me. So, question one, can something
override this in someway? Some other setting perhaps?

Now, to get the 90 minute inactivity timeout I would need to set
session.cookie-lifetime to 5400 (seconds). This means the session ending on
broswer close won't work though, as it's the same setting I was to set to 0.

Can I have my cake AND eat it so to speak? Or is this a limitation of
sessions?

Thanks

Posted by Jerry Stuckle on June 24, 2008, 3:18 pm
Please log in for more thread options
David Gillen wrote:
> Hi.
>
> I've 2 requirements
> - session will end when browser is closed
> - session will end after 90 minutes inactivity.
>
> Now, from the documentation session.cookie-lifetime when set to 0 _should_
> cause the session to end when the browser is closed, although at the moment
> this doesn't appear to be the case for me. So, question one, can something
> override this in someway? Some other setting perhaps?
>
> Now, to get the 90 minute inactivity timeout I would need to set
> session.cookie-lifetime to 5400 (seconds). This means the session ending on
> broswer close won't work though, as it's the same setting I was to set to 0.
>
> Can I have my cake AND eat it so to speak? Or is this a limitation of
> sessions?
>
> Thanks
>

You can't guarantee the session will be closed when the browser closes -
all you can do is recommend it. Since it's on the user's computer, the
user can change the value and/or have the browser ignore it all together.

I'd recommend you just leave it at 90 minutes - or keep it short, i.e.
15 minutes, to ensure they are still active.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================


Posted by Michael Fesser on June 24, 2008, 6:18 pm
Please log in for more thread options
.oO(David Gillen)

>I've 2 requirements
>- session will end when browser is closed
>- session will end after 90 minutes inactivity.
>
>Now, from the documentation session.cookie-lifetime when set to 0 _should_
>cause the session to end when the browser is closed, although at the moment
>this doesn't appear to be the case for me. So, question one, can something
>override this in someway? Some other setting perhaps?

The entire browser (all windows!) has to be closed for the session
cookies to be deleted, not just the current tab.

>Now, to get the 90 minute inactivity timeout I would need to set
>session.cookie-lifetime to 5400 (seconds). This means the session ending on
>broswer close won't work though, as it's the same setting I was to set to 0.

With a lifetime other than 0 it's not a session cookie anymore. Leave it
as it is. For controlling the session's timeout value, check out
session.gc_maxlifetime and see the manual for details.

Micha

Posted by thomasalfh on July 5, 2008, 1:47 am
Please log in for more thread options
> Hi.
>
> I've 2 requirements
> -sessionwillendwhen browser is closed
> -sessionwillendafter 90 minutes inactivity.
>
> Now, from the documentationsession.cookie-lifetime when set to 0 _should_
> cause thesessiontoendwhen the browser is closed, although at the moment
> this doesn't appear to be the case for me. So, question one, can something
> override this in someway? Some other setting perhaps?
>
> Now, to get the 90 minute inactivity timeout I would need to
setsession.cookie-lifetime to 5400 (seconds). This means thesessionending on
> broswer close won't work though, as it's the same setting I was to set to 0.
>
> Can I have my cake AND eat it so to speak? Or is this a limitation of
> sessions?
>
> Thanks

I have used session.timeout = 90 or some other value to trigger the
session to timeout. I dont remember if the value is in minutes or secs
though

Similar ThreadsPosted
Session example problem November 7, 2004, 3:19 pm
PHP Session Problem December 12, 2004, 8:44 am
Session problem December 24, 2004, 12:50 am
session problem January 12, 2005, 8:43 am
session problem January 13, 2005, 3:30 am
session problem January 14, 2005, 3:13 am
php session problem in IE 6.0 February 17, 2005, 12:17 pm
Problem with session SID May 6, 2005, 11:58 am
problem with session June 24, 2005, 10:51 am
Session problem September 20, 2005, 3:15 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap