How many ways you can delete a session variable ?
Answers were Sorted based on User's Feedback
Answer / chetan
session_destroy()
....// it will delete all session variables at once
unset
session_unregister()
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / anoop
The correct answer is 4 ways .
1 UNSET();
2 session_unset()
3 seesion_unregister()
4 session_destroy()
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / anuj kumar gupta
session_destroy() — Destroys all data registered to a session
session_unregister() — Unregister a global variable from the
current session
session_unset() — Free all session variables
If globals is on, you'll have to unset the
$_SESSION[varname] as well as the $varname.
Like:
unset($_SESSION[varname]);
unset($varname);
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / hemant gore
unset($_SESSION)
session_unset()
seesion_unregister()
session_destroy()
| Is This Answer Correct ? | 3 Yes | 0 No |
How to create an empty array in php?
Explain about PHP filter and why it should be used?
What are the correct and the most two common way to start and finish a PHP block of code?
How to redirect https to http url through .htaccess?
Is string php function?
What is an example of a variable?
How can we get ip address of a client in php?
What is a php object?
What is the use of "ksort" in php?
Write down the benefits of php7?
What is difference between echo and print in php?
Explain about image types in detail?