Session_start()

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

    Session_start()

    I get this error message: A session had already been started - ignoring
    session_start() .

    How can I check to see if a session was started already?

    Thanks
  • Andy Hassall

    #2
    Re: Session_start()

    On Mon, 16 Jan 2006 17:43:46 -0500, camou <camou@camou> wrote:
    [color=blue]
    >I get this error message: A session had already been started - ignoring
    >session_start( ).
    >
    >How can I check to see if a session was started already?[/color]

    Probably http://uk2.php.net/session_id

    --
    Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
    http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

    Comment

    • Pedro Graca

      #3
      Re: Session_start()

      camou wrote:[color=blue]
      > I get this error message: A session had already been started - ignoring
      > session_start() .
      >
      > How can I check to see if a session was started already?[/color]


      if (!session_id()) {
      /* session not started */
      }

      --
      If you're posting through Google read <http://cfaj.freeshell. org/google>

      Comment

      • Steve

        #4
        Re: Session_start()

        On Tue, 17 Jan 2006 00:17:03 +0000, Pedro Graca wrote:
        [color=blue]
        > camou wrote:[color=green]
        >> I get this error message: A session had already been started - ignoring
        >> session_start() .
        >>
        >> How can I check to see if a session was started already?[/color]
        >
        >
        > if (!session_id()) {
        > /* session not started */
        > }[/color]
        I thought it was

        if (session_id() == "")
        {
        /* session not started */
        }

        Steve

        Comment

        • Tim Van Wassenhove

          #5
          Re: Session_start()

          On 2006-01-17, Steve <ThisOne@Aint.V alid> wrote:[color=blue]
          > On Tue, 17 Jan 2006 00:17:03 +0000, Pedro Graca wrote:
          >[color=green]
          >> camou wrote:[color=darkred]
          >>> I get this error message: A session had already been started - ignoring
          >>> session_start() .
          >>>
          >>> How can I check to see if a session was started already?[/color]
          >>
          >>
          >> if (!session_id()) {
          >> /* session not started */
          >> }[/color]
          > I thought it was
          >
          > if (session_id() == "")
          > {
          > /* session not started */
          > }[/color]

          There are some usercomments about that in the manual on


          I prefer to do it as following:

          if (!isset($_SESSI ON)) {
          // session is not started.
          }

          As documented on http://www.php.net/session the global $_SESSION only becomes
          available after the use of session_start() ;

          --
          Met vriendelijke groeten,
          Tim Van Wassenhove <http://timvw.madoka.be >

          Comment

          Working...