Hi,
I have a problem with sessions that has me stumped. In short i have a page we'll call firstPage and a secondPage - the problem is:
first page uses 'session_start()' func to instigate a new session a few lines of code later there is a check to see if a session variable called, 'loginOK', issset - if not the header() function is used to redirect to a login page - the login page (secondPage) too starts with session_start() and a form on the page gets a users login detail, checks against DB blah blah. If login successful set a session variable to 'loginGood' redirect back to firstPage.
OK - all that is wotking fine, here it comes ...but: PHP keeps on starting two sessions. I thought the purpose of session_start() was a check to see if a session was already started - if so, use that session - if not, start a new session.
I've ensured that header() appears before any other read statements and session_start() is at the very top of each page (before header(). I have some identical session examples from a book that i use and tested on my installation and they work just fine, i.e. only one session variable is present in the temp folder.
So why is my login page (secondPage) starting a new session when my fistPage has already begun one. More importantly when i create other pages which need to join the session are they too going to create a seperate session?? Im using sessions without cookies using PHPSESSID - passed by URL.
any help appreciated - thanx in advanz
bePuzzled of someplace ...