destroy session id

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
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

destroy session id

Post by AVATAr »

a friend of mine have this problem.:

Code: Select all

<?php
	session_start();
	session_unset();
	session_destroy()
?>
html stuff
he use this code to destroy the session, but when he creates the session again THE SAME SESSION ID is created.. any comments?
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

I had problems usign session_unset(), so I tried something like this:

Code: Select all

<?php 
   session_start(); 
   $_SESSION = array();
   unset($_COOKIE&#1111;'session_name_here']);
   session_destroy();
?>
And it works on my site.
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

thanks, i was reading the online manual.. and i found that soution.. i'll tell my friend of it.. ;)
Post Reply