Saturday, 31 August 2013

What does session_destroy() do in PHP?

What does session_destroy() do in PHP?

In PHP manual, the description for session_destroy() function is :
session_destroy() destroys all of the data associated with the current
session. It does not unset any of the global variables associated with the
session, or unset the session cookie. To use the session variables again,
session_start() has to be called.
I am confused about this description. If this function destroys all
session data, then why the global variables associated with the session
are not unset? Why can we use the session variables again?

No comments:

Post a Comment