How many ways you can delete a session variable ?

Answers were Sorted based on User's Feedback



How many ways you can delete a session variable ?..

Answer / prasad

two ways

Seesion_destroy
unset

Is This Answer Correct ?    28 Yes 1 No

How many ways you can delete a session variable ?..

Answer / chetan

session_destroy()
....// it will delete all session variables at once
unset
session_unregister()

Is This Answer Correct ?    4 Yes 0 No

How many ways you can delete a session variable ?..

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

How many ways you can delete a session variable ?..

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

How many ways you can delete a session variable ?..

Answer / hemant gore

unset($_SESSION)
session_unset()
seesion_unregister()
session_destroy()

Is This Answer Correct ?    3 Yes 0 No

How many ways you can delete a session variable ?..

Answer / john suresh

only one way

Is This Answer Correct ?    4 Yes 10 No

Post New Answer

More PHP Interview Questions

write code to find the date difference b/w two given date using PHP not MYSQL function?

3 Answers   HyperQuality, Synctra Solutions,


How do you develop your own PHP extension ?

2 Answers  


What is the array in php?

0 Answers  


Explain different sorting function in php?

0 Answers  


what method is used to generate a random number?

4 Answers  






What is array filter php?

0 Answers  


What type of headers that PHP supports?

0 Answers  


Does wordpress run on php 7?

0 Answers  


How can you parse files that were not ending with .php by using Apache?

1 Answers  


How can you declare the array in php?

0 Answers  


How do sessions work in php?

0 Answers  


Which framework is best for php?

0 Answers  


Categories