Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within PHP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
PHP
Need to implement Session time out in PHP code
sudeep naayak
Greenhorn
Posts: 5
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hay there
I have tried with the following code
<?php session_start(); $session_life = time() - $_SESSION['start']; if($session_life > $inactive) { session_destroy(); header("Location: error.php"); } ?>
This code I used at the scratch of my code.
Its not working. I dont have the access to php.ini at my server.
Can anybody help me out.
K. Tsang
Bartender
Posts: 3648
16
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
you can view the settings of php.ini using "echo phpinfo()".
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
sudeep naayak
Greenhorn
Posts: 5
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks K. Tsang
I tried it in another way and it worked.
<?php session_cache_expire( 10 ); session_start(); $inactive = 600; if(isset($_SESSION['start']) ) { $session_life = time() - $_SESSION['start']; if($session_life > $inactive) { $_SESSION["logged_in"] = false;$_SESSION["username"]=""; $_SESSION["errmsg"]="Session Expired"; header("Location: error.php"); } } $_SESSION['start'] = time(); ?>
By the way thanks for your attention and valuable time.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Multiple Actions issue in JSF
MultiDimenaional Array sort
Need Random unique variable value in PHP 5
Jboss 5.1.0 jsp:root not working
Java Server, PHP client
More...