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 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? 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']; 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.) Link to comment https://forums.phpfreaks.com/topic/202133-problems-with-sessions/#findComment-1060011 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.