User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Feb 2006
Posts: 5
Reputation: dsureesh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
dsureesh dsureesh is offline Offline
Newbie Poster

Question Session

  #1  
Feb 21st, 2006
hi all,
iam sureesh, iam doing a online project in php, i want know how we can use sessions in php.......
how to make session end when the user click the logout button
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2005
Posts: 354
Reputation: DanceInstructor is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 12
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: Session

  #2  
Feb 21st, 2006
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.
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote  
Join Date: Feb 2006
Posts: 5
Reputation: dsureesh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
dsureesh dsureesh is offline Offline
Newbie Poster

Re: Session

  #3  
Feb 22nd, 2006
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
Reply With Quote  
Join Date: Jun 2005
Location: Kansas City, Missouri, USA
Posts: 344
Reputation: Troy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 4
Troy's Avatar
Troy Troy is offline Offline
Posting Whiz

Re: Session

  #4  
Mar 4th, 2006
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.
Troy Wolf is the author of SnippetEdit. "Website editing as easy as it gets." IX Web Hosting
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 7:31 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC