Forum Moderators: coopster

Message Too Old, No Replies

sesion duration problems

how can i exceed 24 min?

         

omoutop

1:17 pm on Mar 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hello people,

quick question (hopefully)...

How can i exceed the 24 min duration of sessions? I mean if i left my browser window open fom more than 24mins and do nothing (idle window) the sessions will expire.

All i want is to have IE window close when one specific session expires (i know its brutal but this is how it must be done). Any ideas fellows?

tomda

1:24 pm on Mar 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



All i want is to have IE window close when one specific session expires (i know its brutal but this is how it must be done). Any ideas fellows?

Only IE or all browsers?
I guess you can use Javascript - window.close() - but what about Javascript disabled users?

How can i exceed the 24 min duration of sessions? I mean if i left my browser window open fom more than 24mins and do nothing (idle window) the sessions will expire.
Are you sure you are speaking about sessions and not cookies?
Sessions are there as long as the user stay in the site, once you leave the site, sessions are gone... The duration limit of the session is set by the webmaster and they are many many way to expire a session (from what I understand here, it will expire only if you do nothing for 24 minutes?)

OK, I am off for today!
Cheers

omoutop

1:46 pm on Mar 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



not only IE but all browsers, that is correct.

And for the seconf part, i need a method to close active window after a set time (20 mins for example), without doing refresh in page

barns101

4:20 pm on Mar 23, 2006 (gmt 0)

10+ Year Member



How can i exceed the 24 min duration of sessions?

Save your session data in your webspace instead of the /tmp folder if on a shared server and then set the maximum session lifetime:


<?php
session_save_path("/home/x/public_html/temp"); // Where the session data will be saved
ini_set( 'session.gc_probability', ( int )100 ); // Deletes old session data
ini_set( 'session.gc_maxlifetime', 1440 ); // Maximum life of session (in seconds)
session_start();
?>

You need to include all of that code on every script that is to access the session data.

I need a method to close active window after a set time (20 mins for example), without doing refresh in page.

Not sure that's possible. Maybe a JavaScript to count down for 2 minutes and then close the window. But then there will always be users without JavaScript.

omoutop

7:10 am on Mar 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



interesting approach barns, thanks. I will test it and see what will happen

btw, what is the max session time i could give for session expiration? could i declare it as 1 hour? Or even as 24hours?

barns101

1:41 pm on Mar 24, 2006 (gmt 0)

10+ Year Member



I have just checked the PHP manual for sessions (http://uk.php.net/session) and there is no stated maximum value. Just remember to calculate it is seconds.