Sessions: How do I get rid of them?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sdouble
Forum Newbie
Posts: 1
Joined: Sat Jan 11, 2003 5:27 pm
Location: Iowa, USA

Sessions: How do I get rid of them?

Post by sdouble »

I know that session_destroy() will delete them. This is what I am trying to do, but I want it to be automated. Someone told me I can set a time limit for sessions in the php.ini file. What line would I edit in there in order to do this? I tried the one I assumed it to be and reloaded Apache but it didn't seem to work. Basically I am wanting my sessions to expire and delete themselves and can't find any information about how to do it. Any help is greatly apreciated.

Thanks!
User avatar
Elmseeker
Forum Contributor
Posts: 132
Joined: Sun Dec 22, 2002 5:48 am
Location: Worcester, MA

Post by Elmseeker »

Here's what you need to find in php.ini:

Code: Select all

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 3600
There are also several other lines in that area of the file that you should look into, that is the section dealing with sessions.
Post Reply