Edgewalker81 Posted December 1, 2008 Share Posted December 1, 2008 I keep getting this error, even though I know my code is correct. I'm attempted to use "session_start();" at the very beginning of a file. Link to comment https://forums.phpfreaks.com/topic/135070-solved-persistent-error-cannot-send-session-cookie-headers-already-sent-by/ Share on other sites More sharing options...
Edgewalker81 Posted December 1, 2008 Author Share Posted December 1, 2008 Aha! This was a little surprising, so it might help someone else to know. If you are getting this error, and your code is correct, this may be your problem: I have been saving my files in UTF-8 format, but it looks like the byte-order-mark was somehow being outputted at the start of the file. The solution was to save as "ANSI" or "UTF without BOM," which may actually be equivalent. Link to comment https://forums.phpfreaks.com/topic/135070-solved-persistent-error-cannot-send-session-cookie-headers-already-sent-by/#findComment-703515 Share on other sites More sharing options...
PFMaBiSmAd Posted December 1, 2008 Share Posted December 1, 2008 We already know that because it is a common problem. Posting your actual error message and corresponding code would have allowed someone to directly provide that solution. Link to comment https://forums.phpfreaks.com/topic/135070-solved-persistent-error-cannot-send-session-cookie-headers-already-sent-by/#findComment-703517 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.