SESSIONs

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
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

SESSIONs

Post by ol4pr0 »

i have read the pervious post about the sessions that couldnt be destroyed.

i have php 5 installed at home and php 4 installed on the server both give me the same problem

Code: Select all

<?
session_start();
$_SESSION = array();
session_destroy();
session_unset("x");
session_unset("y");
session_unset("z");
?>
Tried them almost all i think. however they are not being destoyed or unset. Only a closing browser will unset them.
duk
Forum Contributor
Posts: 199
Joined: Wed May 19, 2004 8:45 am
Location: London

Post by duk »

just

Code: Select all

<?php

session_start();
session_unset();

?>
will not unset all variables ????

i use this and unset all variables...
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Had same problem before.
This fixed it though

Code: Select all

session_unset();
$_SESSION = array();
session_destroy();
setcookie(session_name(),"",0,"/");
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

Thanks that most certenly did it lol
Post Reply