usawh Posted May 18, 2010 Share Posted May 18, 2010 Hi, I am getting this error message with my session login. Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/h/i/l/html/login101.php:1) in /home/content/h/i/l/html/login101.php on line 2 Quote Link to comment https://forums.phpfreaks.com/topic/202133-problems-with-sessions/ Share on other sites More sharing options...
scampbell Posted May 18, 2010 Share Posted May 18, 2010 What are in those lines referenced? Do they output anything to the browser? Quote Link to comment https://forums.phpfreaks.com/topic/202133-problems-with-sessions/#findComment-1059980 Share on other sites More sharing options...
usawh Posted May 18, 2010 Author Share Posted May 18, 2010 here is the begining coding <?php session_start(); $username = $_POST['username']; $password = $_POST['password']; Quote Link to comment https://forums.phpfreaks.com/topic/202133-problems-with-sessions/#findComment-1059983 Share on other sites More sharing options...
PFMaBiSmAd Posted May 18, 2010 Share Posted May 18, 2010 output started at ....../login101.php:1 (line 1) Output started at .... line 1 in your file, if you have no actual characters in your file before the <?php tag, usually means your file has been saved as a UTF-8 encoded file and the BOM (Byte Order Mark) characters that your editor placed at the start of the file is the output that is preventing the headers from working. Save your file without the BOM characters or save it as an ANSI encoded file (not a UTF-8 encoded file.) Quote Link to comment https://forums.phpfreaks.com/topic/202133-problems-with-sessions/#findComment-1060011 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.