PDA

View Full Version : Increase Timeout?



Rhyfelwr
07-29-2009, 01:57 PM
Don't know if this is something that can be easily put into the site, but with long posts, I am constantly being timed out and have to log back in again which is a pain!

I understand the security reasons, but the limit is possibly too short.

Does everyone else have this problem?


For ConfusedCartman....

Don't know if you use sessions or cookies for login.

If you wanted to change it, it should be a simple inclusion into the header page (included? include()?)



session_start();//no need to duplicate

// set timeout period in seconds
$inactive = 600;

// check to see if $_SESSION['timeout'] is set
if(isset($_SESSION['timeout']) ) {
$session_life = time() - $_SESSION['timeout'];
if($session_life > $inactive)
{ session_destroy(); header("Location: logoutpage.php"); }//whatever page says you are logged out.
}
$_SESSION['timeout'] = time();


Is this feasible?

Rhy

RockSauron
07-29-2009, 02:13 PM
Hm... wouldn't just clicking "Remember Me" prevent you from logging out?

Rhyfelwr
07-29-2009, 02:29 PM
Hm... wouldn't just clicking "Remember Me" prevent you from logging out?

LOL - what a pratt I am!!!

Didn't know these were persistent cookies!

I was thinking that if we were switching users on the same laptop, we couldn't do this.. but I was wrong - thanks Rock.

Rhy

Admin - please close this thread before I make even more of a fool of myself :blush:

EDIT
_________

Oooh - just thought of someting to justify myself.. what if you have cookies blocked in your security settings?

Nah that's lame - I still look a pratt.

RockSauron
07-29-2009, 03:44 PM
Eh, that's ok- you're not the first guy who had a deep knowledge of programming and vbulletin software who made a topic like this forgetting about that button :p. You're the second, so at least take comfort in the fact that someone else made a topic like this with a solution that got in depth... Meyep.