Link to home
Start Free TrialLog in
Avatar of sandhya01
sandhya01

asked on

Idle timeout in Apache/php

Hi experts,
How should i implement the idle timeout functionality in my php pages. I want to set a centralized idle timeout setting. Instead of setting it in all php pages, is there any way i can do it in a centralized manner. The php pages are deployed in apache server.
I want the idle time out to be set as 30min.

Thanks
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

What do you want to make happen after the 30 minutes?
Avatar of sandhya01
sandhya01

ASKER

I want it to get redirected to my logout.php page.

Is there something that can be done in .htaccess or php.ini file, as i am interested in providing a centralized idle time out setting.
SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi
I have created a logout.php page seperately, that handles all my session related variables and cookies.
so by including this in all the page:

$logout_url = 'http://'.$_SERVER['HTTP_HOST'].'/logout.php';
header( "refresh: 1800; url=$logout_url");

I am able to provide the idle time out feature in my php pages.

What you all think of the above code, is it fine to do like this/

Thanks

I think that would work.  It does the same thing as the <meta> tag - tells the browser to start a clock and where to go when the clock expires.

Either way, meta or header, the refresh IS GOING TO OCCUR when the clock expires, even if the cleint is still typing.  

Best regard, ~Ray
The answer were good but I had a better solultion to the questions, which even was accepted by the Experts. Even though, I express thanks to everyone who tried to help me.

Thanks
sandhya01: For the benefit of others, would you please post your solution?  Thanks. ~Ray