cooldude832 Posted May 15, 2007 Share Posted May 15, 2007 I have a script that says <? session_start(); ob_start(); ?> and it gives me Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /hsphere/local/home/pira00/upperstraitscleanlake.org/horse/login.php:1) in /hsphere/local/home/pira00/upperstraitscleanlake.org/horse/login.php on line 2 why? my autosession start is set to manual and i think i'm running php 4.4.4 Quote Link to comment https://forums.phpfreaks.com/topic/51411-solved-php-session-errors-warning-session_start-cannot-send-session-cache-limiter/ Share on other sites More sharing options...
cooldude832 Posted May 15, 2007 Author Share Posted May 15, 2007 I have read the php headers Errors page and still no help I can have just 1 line of code and any header mod it errors on. Please Help. Quote Link to comment https://forums.phpfreaks.com/topic/51411-solved-php-session-errors-warning-session_start-cannot-send-session-cache-limiter/#findComment-253189 Share on other sites More sharing options...
hitman6003 Posted May 15, 2007 Share Posted May 15, 2007 sessions use cookies...if output has been sent to the browser before it can send the cookie header, it will fail. EDIT: This means that if you have a newline at the top of your php script, before the opening tag, it will output a newline...which will cause your header to fail... ///top of file, blank "newline" can't be here <?php .... ?> Quote Link to comment https://forums.phpfreaks.com/topic/51411-solved-php-session-errors-warning-session_start-cannot-send-session-cache-limiter/#findComment-253192 Share on other sites More sharing options...
cooldude832 Posted May 15, 2007 Author Share Posted May 15, 2007 <?php $start = session_start(); $ob = ob_start(); ?> In notepad++ UTF-8 encoding I've tried doing it in notepad also using UTF-8 no good. I do not have any comments pre <?php Quote Link to comment https://forums.phpfreaks.com/topic/51411-solved-php-session-errors-warning-session_start-cannot-send-session-cache-limiter/#findComment-253195 Share on other sites More sharing options...
john010117 Posted May 15, 2007 Share Posted May 15, 2007 Just try: <?php session_start(); ob_start(); ?> See if that works. Quote Link to comment https://forums.phpfreaks.com/topic/51411-solved-php-session-errors-warning-session_start-cannot-send-session-cache-limiter/#findComment-253197 Share on other sites More sharing options...
kenrbnsn Posted May 15, 2007 Share Posted May 15, 2007 There have been instances of some editors putting an unprintable character at the very start of the file. What editor do you use to write your script? Try deleting the "<?php" line and retyping it. Ken Quote Link to comment https://forums.phpfreaks.com/topic/51411-solved-php-session-errors-warning-session_start-cannot-send-session-cache-limiter/#findComment-253198 Share on other sites More sharing options...
cooldude832 Posted May 15, 2007 Author Share Posted May 15, 2007 removal of the <?php did not work check out: http://upperstraitscleanlake.org/horse/login.php and see the error for your self editor is notepad++ utf-8 it does do pretty print. Quote Link to comment https://forums.phpfreaks.com/topic/51411-solved-php-session-errors-warning-session_start-cannot-send-session-cache-limiter/#findComment-253201 Share on other sites More sharing options...
cooldude832 Posted May 15, 2007 Author Share Posted May 15, 2007 I did it in ascii in notepad and no error. Strange how utf-8 fails and ascii works thanks. Quote Link to comment https://forums.phpfreaks.com/topic/51411-solved-php-session-errors-warning-session_start-cannot-send-session-cache-limiter/#findComment-253202 Share on other sites More sharing options...
john010117 Posted May 15, 2007 Share Posted May 15, 2007 I use the same program. Try to edit PHP in ANSCI mode from now on. Quote Link to comment https://forums.phpfreaks.com/topic/51411-solved-php-session-errors-warning-session_start-cannot-send-session-cache-limiter/#findComment-253208 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.