How to end a session?

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

Locked
User avatar
farid
Forum Commoner
Posts: 54
Joined: Thu Nov 11, 2004 4:20 pm
Location: Mexico

How to end a session?

Post by farid »

:oops: :(

Hi !!! I want to know if someone could help :

1. If there is a function to end a session in PHP? or How do I suppose to end session_start()?
2. Exists a function to obtain the IP adress of a user in PHP?

Thanks

:P
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post by lostboy »

1. unset($_SESSION) will unset all session variables

2. http://ca.php.net/manual/en/function.gethostbyname.php or $_SERVER['REMOTE_ADDR']
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

Use [php_man]session_destroy[/php_man] to end an session ;)
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

DO NOT doublepost, farid. Normally I would delete this, but since it has replies, I'll just lock it.
User avatar
farid
Forum Commoner
Posts: 54
Joined: Thu Nov 11, 2004 4:20 pm
Location: Mexico

Thankss!!!

Post by farid »

Thanks everyone, and sorry about the double post man!!

:D
Locked