Session_Start() Hangs after setting Session_Id

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

    Session_Start() Hangs after setting Session_Id

    Hello, I am trying to do the following in one of my pages.
    session_id($_GE T['SESSIONID']);
    session_start() ;

    I am running php5, however as soon as I call session_start the script
    hangs and nothing happens. Is anyone else experiencing this problem, or
    am I doing something incorrectly?

    Thanks!

  • Syl

    #2
    Re: Session_Start() Hangs after setting Session_Id


    CjB wrote:[color=blue]
    > Hello, I am trying to do the following in one of my pages.
    > session_id($_GE T['SESSIONID']);
    > session_start() ;
    >
    > I am running php5, however as soon as I call session_start the script
    > hangs and nothing happens. Is anyone else experiencing this problem, or
    > am I doing something incorrectly?
    >
    > Thanks![/color]

    session_start() ; must always be listed at the top of every page.
    like this :

    <?php
    session_start() ;

    Comment

    • Tony Marston

      #3
      Re: Session_Start() Hangs after setting Session_Id


      "Syl" <david.hunter@g mail.com> wrote in message
      news:1151631588 .219436.322850@ d56g2000cwd.goo glegroups.com.. .[color=blue]
      >
      > CjB wrote:[color=green]
      >> Hello, I am trying to do the following in one of my pages.
      >> session_id($_GE T['SESSIONID']);
      >> session_start() ;
      >>
      >> I am running php5, however as soon as I call session_start the script
      >> hangs and nothing happens. Is anyone else experiencing this problem, or
      >> am I doing something incorrectly?
      >>
      >> Thanks![/color]
      >
      > session_start() ; must always be listed at the top of every page.
      > like this :
      >
      > <?php
      > session_start() ;
      >[/color]

      That is not necessarily true. It does NOT have to be the very first
      statement in the script, but BEFORE you want to start using the $_SESSION
      array.

      You need to check that you have a value in $_GET['SESSIONID'] before you use
      it. Try this:

      if (isset($_GET['SESSIONID'])) {
      session_id($_GE T['SESSIONID']);
      } // if
      session_start() ;

      --
      Tony Marston
      This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL

      Build apps faster with Rapid Application Development using open-source RAD tools, modern RAD frameworks, and rapid application design methods.



      Comment

      • Syl

        #4
        Re: Session_Start() Hangs after setting Session_Id


        Tony Marston wrote:[color=blue]
        > "Syl" <david.hunter@g mail.com> wrote in message
        > news:1151631588 .219436.322850@ d56g2000cwd.goo glegroups.com.. .[color=green]
        > >
        > > CjB wrote:[color=darkred]
        > >> Hello, I am trying to do the following in one of my pages.
        > >> session_id($_GE T['SESSIONID']);
        > >> session_start() ;
        > >>
        > >> I am running php5, however as soon as I call session_start the script
        > >> hangs and nothing happens. Is anyone else experiencing this problem, or
        > >> am I doing something incorrectly?
        > >>
        > >> Thanks![/color]
        > >
        > > session_start() ; must always be listed at the top of every page.
        > > like this :
        > >
        > > <?php
        > > session_start() ;
        > >[/color]
        >
        > That is not necessarily true. It does NOT have to be the very first
        > statement in the script, but BEFORE you want to start using the $_SESSION
        > array.
        >
        > You need to check that you have a value in $_GET['SESSIONID'] before you use
        > it. Try this:
        >
        > if (isset($_GET['SESSIONID'])) {
        > session_id($_GE T['SESSIONID']);
        > } // if
        > session_start() ;
        >
        > --
        > Tony Marston
        > http://www.tonymarston.net
        > http://www.radicore.org[/color]


        Of course - you are absolutely correct Tony.

        Thanks for clarifying my post.

        Comment

        Working...