session start warning, headers already sent
Posted: Sat Feb 02, 2008 1:03 pm
Hi,
If there is a better post for this, just let me know.
I am building a php site with a login page, a log out page, and a create user page. I'm using sessions to keep track of users. On my main login page I am getting the following errors:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /Library/WebServer/Documents/officialtix/includes/session.php:1) in /Library/WebServer/Documents/officialtix/includes/session.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /Library/WebServer/Documents/officialtix/includes/session.php:1) in /Library/WebServer/Documents/officialtix/includes/session.php on line 2
It seems like it's saying that I need to start the session before anything else. And that the way it is now, that's not the case. But, in my document session_start() is the first command to be executed. (I'm using and include at the top of the page to include session.php and the first command in session.php is session_start(). So what is the problem?
The only thing I could think of is that my page uses frames. And this is the first line in the main window, not the whole framset. But I when I was testing it out the first time, everything seemed to work. (I was able to cofirm I was in a session, and also delete the session cookie and see I was completely logged out)
Any ideas?!?!
If there is a better post for this, just let me know.
I am building a php site with a login page, a log out page, and a create user page. I'm using sessions to keep track of users. On my main login page I am getting the following errors:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /Library/WebServer/Documents/officialtix/includes/session.php:1) in /Library/WebServer/Documents/officialtix/includes/session.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /Library/WebServer/Documents/officialtix/includes/session.php:1) in /Library/WebServer/Documents/officialtix/includes/session.php on line 2
It seems like it's saying that I need to start the session before anything else. And that the way it is now, that's not the case. But, in my document session_start() is the first command to be executed. (I'm using and include at the top of the page to include session.php and the first command in session.php is session_start(). So what is the problem?
The only thing I could think of is that my page uses frames. And this is the first line in the main window, not the whole framset. But I when I was testing it out the first time, everything seemed to work. (I was able to cofirm I was in a session, and also delete the session cookie and see I was completely logged out)
Any ideas?!?!