swatibhatia Posted June 13, 2011 Share Posted June 13, 2011 I am enabling a session at very 1st line of my php page still it gives an warning Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\MyWebApp\index.php:1) in C:\xampp\htdocs\MyWebApp\index.php on line 1 index.php <?php session_start();?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" > <head> <title>Home - Home Page | Value-One (Technology with in Reach)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="Place your description here" /> <meta name="keywords" content="put, your, keyword, here" /> < still it gives an error.. and unable to work with session,, gone thru all header error pages and I dont hv access to php.ini Quote Link to comment https://forums.phpfreaks.com/topic/239228-cannot-send-session-cache-limiter/ Share on other sites More sharing options...
monkeytooth Posted June 13, 2011 Share Posted June 13, 2011 I know this may be a silly question but is "index.php" really above session_start in the file or are you signifying it here as index.php and you forgot to wrap your code in the code block? That error you are receiving is only due to something somewhere some how outputting to your browser prior to that function even so much as hitting enter on the file so there's a bit of white space at the top.. or a space or literally anything output prior to that session start will kill it.. Or, maybe your hosting co has sessions off for some odd reason? Quote Link to comment https://forums.phpfreaks.com/topic/239228-cannot-send-session-cache-limiter/#findComment-1229030 Share on other sites More sharing options...
PFMaBiSmAd Posted June 13, 2011 Share Posted June 13, 2011 Read reply #2 in this sticky thread - http://www.phpfreaks.com/forums/index.php?topic=37442.0 You either have some character(s) on the line before the <?php tag or your file has been saved with the BOM (Byte Order Mark) characters at the start of the file by your editor. Quote Link to comment https://forums.phpfreaks.com/topic/239228-cannot-send-session-cache-limiter/#findComment-1229062 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.