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 |
What is php in full?
Is php strongly typed?
Are sessions stateless?
What is the use of array_search() in php?
How to concatenate two strings together in php?
What is the method to register a variable into a session?
What does the unset() function mean?
What is c++ polymorphism?
Explain the ternary conditional operator in php?
What are the differences between php3 and php4 and php5? What is the current stable version of php? What advance thing in php7?
How to upload file in php?
Where is session id stored?