Session Scope

Discussion in 'PHP' started by dhrystone, Oct 28, 2007.

  1. #1
    What is the scope of a session variable? Will a session variable work outside the current working directory?
     
    dhrystone, Oct 28, 2007 IP
  2. Lordy

    Lordy Peon

    Messages:
    1,643
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #2
    yes, the session variable should work outside the directory as long as you are looking for the same information
     
    Lordy, Oct 28, 2007 IP
  3. tonybogs

    tonybogs Peon

    Messages:
    462
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Session variable have global scope so you can use them anywhere
     
    tonybogs, Oct 29, 2007 IP
  4. dhrystone

    dhrystone Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    And what about COOKIES?
     
    dhrystone, Oct 29, 2007 IP
  5. Lordy

    Lordy Peon

    Messages:
    1,643
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #5
    cookies will work depending on what path you set them to. by default, they will work everywhere
     
    Lordy, Oct 29, 2007 IP