Skullptor Posted March 21, 2012 Share Posted March 21, 2012 The session statement was working and then I made a change to the pages and now the sessions will not work. It doesn't carry the variable information forward to the next page. If I insert a session start command I get an error message stating that the sessions have already started. I'm out of ideas on how to fix this. Link to comment Share on other sites More sharing options...
astralaaron Posted March 21, 2012 Share Posted March 21, 2012 make sure session_start(); is before you output anything Link to comment Share on other sites More sharing options...
Skullptor Posted March 21, 2012 Author Share Posted March 21, 2012 I do - it's the first line of the page right after the php tag. Link to comment Share on other sites More sharing options...
astralaaron Posted March 21, 2012 Share Posted March 21, 2012 you might need to post some code for the people here to see Link to comment Share on other sites More sharing options...
thescientist Posted March 21, 2012 Share Posted March 21, 2012 yeah, we need the code. If the SESSION has started, then the SESSION has started. if you are including files with session_start in a file that already has it, then that would be a problem. Also, the error might be telling you where it was already started. Link to comment Share on other sites More sharing options...
[dx] Posted March 21, 2012 Share Posted March 21, 2012 Check for UTF-8 BOM, that was my problem.. Link to comment Share on other sites More sharing options...
justsomeguy Posted March 21, 2012 Share Posted March 21, 2012 If it was working, then you made a change, then it stopped working, then post the changes you made. Something you did caused it to stop working, most likely moving output somewhere before the session starts. Link to comment Share on other sites More sharing options...
Skullptor Posted March 22, 2012 Author Share Posted March 22, 2012 If I posted the code incorrectly I apologize. I don't ususally use forums becuase it takes time to get responses. The LMBconnect.php is only the connection to the database and thesession_start() is not in that file. If I start the session somewhere within the site then I should be able to use session variables until such time I kill the session. That's why I'm confused with this problem. I just inserted the sessio start in the login page and here are the error messages. If I remove the session start from the login page the errors disappears but the variable doesn't work either. Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/62/8168562/html/memberlogin.php:1) in /home/content/62/8168562/html/memberlogin.php on line 2Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/62/8168562/html/memberlogin.php:1) in /home/content/62/8168562/html/memberlogin.php on line 2 Link to comment Share on other sites More sharing options...
thescientist Posted March 22, 2012 Share Posted March 22, 2012 there are code box tags in this forum. Please post all code in them and make sure it's indented, formatted, and easy to read. onto your problem, where are you calling session_start though? Which file throws the error? What exactly does the error say? The error should tell you where to look. You also didn't include the code for LMBmemconnect.php. Is that important at all? Consider revising your post to focus on the specific parts that are causing the issue. Link to comment Share on other sites More sharing options...
justsomeguy Posted March 22, 2012 Share Posted March 22, 2012 Where do you use session_start? Is it in the include file? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.