#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    3
    Rep Power
    0
    To check if it exists, I do

    $id = session_id();
    if ($id == '') {... no session ...}

    If the $id is empty, then there is no session.

    But the problem is when I use the "session_id()" function from a different page than the page that contains the "session_start()" function, the returned $id is always empty.

    Do have I to pass the SID in the url or something? Is there a setup file that I should update?

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    60
    Rep Power
    15
    I think you have to do a session_start(); on every page that you want to call the session info.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    29
    Rep Power
    0
    like the previous post said you need to call the session_start(); function unless your server has it setup so that it always starts a session when it goes into a .php page. you have to start a session in order to get any information on a current session you diig?

    if the browser that you are using to access the page blocks cookies then you should pass
    $SID( i belive the default is $PHPSESSID now) with links so that it knows which session to associate witht he user.

    -Cisk

Similar Threads

  1. start session with existing session id?
    By marco-marco in forum PHP Development
    Replies: 1
    Last Post: February 16th, 2004, 07:05 AM
  2. how do i check an index file exists in a folder?
    By Garrett_44 in forum PHP Development
    Replies: 0
    Last Post: January 4th, 2004, 11:44 AM
  3. Do compilers optimize some / into *?
    By Jason Doucette in forum C Programming
    Replies: 46
    Last Post: December 25th, 2003, 09:47 PM
  4. check if $array["key"] exists?
    By j0sh in forum PHP Development
    Replies: 4
    Last Post: December 13th, 2003, 02:24 PM
  5. Php session
    By toofe in forum PHP Development
    Replies: 1
    Last Post: December 13th, 2003, 11:59 AM

IMN logo majestic logo threadwatch logo seochat tools logo