How can we destroy the session, how can we unset the
variable of a session?
Answers were Sorted based on User's Feedback
Answer / sreenia
the better way of destroying a session is to first unset all
the values of $_SESSION variables individually, and then use
the session_destroy() function
| Is This Answer Correct ? | 17 Yes | 6 No |
Answer / devendrarjadav
session_destroy() function destroys all data registered to
current session. use unset function to destroy varible
specified with session. So to destroy $name registered with
session use unset($name) in your php script.
| Is This Answer Correct ? | 16 Yes | 6 No |
Answer / sri harsha
session can be destroyed by using session_destroy() function
and variable can be unset by unset($_session['name']).
| Is This Answer Correct ? | 11 Yes | 3 No |
Answer / murali
session can be destroyed by using session_destroy() function
and variable can be unset by unset($_session['name']), and
also write like this...
$_session['name']=='';
you can assign null.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / pawan chhabra
// Create a logout.php file then..
<?php
session_start();
header("location:login.php");
session_destroy();
??
| Is This Answer Correct ? | 1 Yes | 3 No |
where to change in php.ini file for file uploading?
What is php sequence?
What is difference between sql and php?
What is the scope of career in PHP/Mysql
What is the purpose of the '.myd' file extension? What do thes file contain?
What are the php functions?
How to call javascript function in php on button click?
What types of images that PHP supports?
can you give me an example code of calling java script function in php variable using AJAX.or with out ajax??????
how to insert logout time when browser close
What are traits?
What is the use of magic function in php?