Session variable doesn't seem to exsist when I uses include

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Hall

    Session variable doesn't seem to exsist when I uses include

    Hello

    I have some variables stored in $_SESSION supr global.

    I have a script that uses an include statement to run another script, but
    however the included script can not recall the $_SESSION variables from the
    SESSION.

    Can anyone tell me why and a way to sort it out?

    Thank you very much


    Chris Hall


  • Pedro Graca

    #2
    Re: Session variable doesn't seem to exsist when I uses include

    Chris Hall wrote:[color=blue]
    > I have a script that uses an include statement to run another script, but
    > however the included script can not recall the $_SESSION variables from the
    > SESSION.
    >
    > Can anyone tell me why and a way to sort it out?[/color]

    Maybe you have the statement order wrong

    WRONG RIGHT
    include 'another_script .php'; session_start() ;
    session_start() ; include 'another_script .php';

    --
    Mail to my "From:" address is readable by all at http://www.dodgeit.com/
    == ** ## !! ------------------------------------------------ !! ## ** ==
    TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
    may bypass my spam filter. If it does, I may reply from another address!

    Comment

    • Virgil Green

      #3
      Re: Session variable doesn't seem to exsist when I uses include

      Chris Hall wrote:[color=blue]
      > Hello
      >
      > I have some variables stored in $_SESSION supr global.
      >
      > I have a script that uses an include statement to run another script,
      > but however the included script can not recall the $_SESSION
      > variables from the SESSION.
      >
      > Can anyone tell me why and a way to sort it out?
      >[/color]

      Yes.

      - Virgil


      Comment

      Working...