LAMPInterview

A Venture from AccuGlobal.com

How can we destroy the session, how can we unset the variable of a session?

Posted by lampinterview on May 14, 2008

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.

2 Responses to “How can we destroy the session, how can we unset the variable of a session?”

  1. AccuGlobal Says:

    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

  2. TechoDesign Says:

    session can be destroyed by using session_destroy() function and variable can be unset by unset($_session['name']).

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>