Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2009
    Location
    Pennsylvania, United States
    Posts
    54
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Question Quick $_SESSION superglobal array question!

    I've been writing a few sample scripts, using session based logins.

    I know what I'm doing, I'm just curious as to why do some people set $_SESSION = array()?

    Does it make any difference in terms of security by not setting $_SESSION to array()?

    Somebody explain please?

  • #2
    Regular Coder
    Join Date
    Nov 2009
    Location
    Hamilton, New Zealand
    Posts
    126
    Thanks
    0
    Thanked 17 Times in 17 Posts
    $_SESSION = array(); can be used to clear the data. ie, like for logging out etc (as opposed to unset()). Also can be used to clear memory.

  • Users who have thanked Rebbu for this post:

    johnnnn (11-29-2009)


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •