Home » » session_unset

session_unset

Written By 1 on Sunday, September 30, 2012 | 9:39 AM

void session_unset ( void )

Free all session variables

The session_unset() function frees all session variables currently registered.


i always do like this to logout:

<?php

session_start
();

session_destroy();

?>



worked 100% with me, on ie, opera (windows, puppy linux 4.3.1, ubuntu and android), firefox, chrome, dolphin hd (android) and even android 2.1 default web browser!



you can try to check the content and destroy it like this:

<?php

session_start
();

session_destroy();

if(
count($_SESSION) == 0)

{

$_SESSION=array();

session_destroy();

}

?>



remember:

allways put this in the very beginning of the html code or other php scripts...

if you put under <html> tag, you gonna have a bad time...


SignUp form, SignIn form, Database, Session Variable: PHP & MySQL

0 Comment:

Post a Comment