Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Difference in using session_unset() and session_destroy() in PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 329
    Comment on it

    For just the functioning part both the syntax will work the same but by writing session_unset will clears the $_SESSION variable but will not destroy the variables and it will initialize to this stage:-

    $_SESSION = array();
    

    session_destroy(); is deleting the whole session. session_unset(); deletes only the variables from session but session still exists. It will just truncate the variable

 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: