SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2004
    Location
    South Africa
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    referencing a session using a local variable

    hi all,

    if i reference a session using a local variable with the following code:

    PHP Code:
    <?php $myvar = &$_SESSION['myvar']; ?>
    does that mean that when i unset the variable that also unsets the session???

    cheers,
    Tal.

  2. #2
    SitePoint Guru
    Join Date
    May 2003
    Location
    virginia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by talorlik
    hi all,

    if i reference a session using a local variable with the following code:

    PHP Code:
    <?php $myvar = &$_SESSION['myvar']; ?>
    does that mean that when i unset the variable that also unsets the session???

    cheers,
    Tal.
    Yes. This is the kind of thing that you just try out!

    -matt

  3. #3
    Non-Member
    Join Date
    Jan 2004
    Location
    Planet Earth
    Posts
    1,764
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With references, it's a pointer and not a copy, from what I understand anyways


Bookmarks

Posting Permissions

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