•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,899 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,577 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1730 | Replies: 3
![]() |
Sessions expire automatically, I don't think you can force a session to expire. The time limit for a session is set by the session.cache_expire directive. You should be able to set this directive at the beginning of your script using the ini_set function. That way you determine how long the session will last. I think normally a session will expire after 3 minutes.
•
•
Join Date: Feb 2006
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
Originally Posted by DanceInstructor
Sessions expire automatically, I don't think you can force a session to expire. The time limit for a session is set by the session.cache_expire directive. You should be able to set this directive at the beginning of your script using the ini_set function. That way you determine how long the session will last. I think normally a session will expire after 3 minutes.
Thank you for ur response
d.sureesh, MCA
•
•
Join Date: Jun 2005
Location: Kansas City, Missouri, USA
Posts: 344
Reputation:
Rep Power: 4
Solved Threads: 4
Actually, you can effectively end a session using:
[PHP]session_unset();
session_destroy();[/PHP]
Alternatively, you may find my PHP session class helpful.
http://www.troywolf.com/articles/php/class_session/
NOTE: my session class does not use PHP's built-in sessions. The class comes with methods and code examples to do login and logout. The purpose of my class is to have complete control over session timeout. I write web apps that need to work like normal business data-entry apps. Users expect to login and STAY logged in all day--no session expirations. My class lets you do this.
[PHP]session_unset();
session_destroy();[/PHP]
Alternatively, you may find my PHP session class helpful.
http://www.troywolf.com/articles/php/class_session/
NOTE: my session class does not use PHP's built-in sessions. The class comes with methods and code examples to do login and logout. The purpose of my class is to have complete control over session timeout. I write web apps that need to work like normal business data-entry apps. Users expect to login and STAY logged in all day--no session expirations. My class lets you do this.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
Similar Threads
- Session end (PHP)
- Session variable (ASP.NET)
- session variable:again (ASP.NET)
- how can i used session and cookies ??? (PHP)
- How to maintain session for Web Services Object? (VB.NET)
Other Threads in the PHP Forum
- Previous Thread: Need Advise On Clever Algorithm
- Next Thread: which is faster? looking in a dir or MySQL


Linear Mode