Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • What is difference between session_unset() and session_destroy() in PHP -

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.65k
    Comment on it

    The functioning part both the syntax will work the same but by inditing session_unset will clears the $_SESSION variable but will not ravage the variables and it will initialize to this stage:

    session_unset(); effaces only the variables from session but session still subsists. It will just truncate the variable - session_unset does not take any parameters. It liberates ALL session variables.

    How it works

     <?php
       // only remove all session variables
       session_unset(); 
    ?>
    

    session_destroy(); is deleting the all session.
    session_destroy Ravages all data registered to a session

    <?php
    // destroy all the session 
    session_destroy(); 
    ?>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: