I need to delete the session variable when I logout a application.
Please let me know which function I can use to delete a session variable.Thanks.
You mean the whole session right?
Try:
session_destroy();
The contents of the $_SESSION[] array can be handled like the contents of any other array:
unset($_SESSION['doomed_variable']) is the obvious method. Prior to 4.3, though there was a bug which means that in earlier versions you'd need to use
$_SESSION['doomed_variable'] = null;
instead.
http://www.phpbuilder.com/board/showthread.php?s=&threadid=10208862