Warning: Session_start() [function.session-start]: Cannot Send Session
Posted On Mon Sep 25, 2006 By hostman In PHP Forums And Topics Discussions About Hyper Text Programming Language Forums
Note: If you are using cookie-based sessions, you must call session_start() before anything is outputted to the browser.
The other day i kept getting this error:
so to fix it I moved the session_start() function from line 26 to line 1 on my header.php file.
That fixed it.
I am posting here just incase anyone else is getting it..
If you have benefited from this post, wallpaperama would appreciate a link back to wallpaperama.com - Thanks
Description
bool session_start ( void )
session_start() creates a session or resumes the current one based on the current session id that's being passed via a request, such as GET, POST, or a cookie.
If you want to use a named session, you must call session_name() before calling session_start().
session_start() will register internal output handler for URL rewriting when trans-sid is enabled. If a user uses ob_gzhandler or like with ob_start(), the order of output handler is important for proper output. For example, user must register ob_gzhandler before session start.
Notes
Note: If you are using cookie-based sessions, you must call session_start() before anything is outputted to the browser.
so what does this all mean really.
ok, i will try to explain more simple.
lets say i have a script that looks like this:
The other day i kept getting this error:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /var/www/a-header.php:10) in /var/www/header.php on line 26
so to fix it I moved the session_start() function from line 26 to line 1 on my header.php file.
That fixed it.
I am posting here just incase anyone else is getting it..
If you have benefited from this post, wallpaperama would appreciate a link back to wallpaperama.com - Thanks
Description
bool session_start ( void )
session_start() creates a session or resumes the current one based on the current session id that's being passed via a request, such as GET, POST, or a cookie.
If you want to use a named session, you must call session_name() before calling session_start().
session_start() will register internal output handler for URL rewriting when trans-sid is enabled. If a user uses ob_gzhandler or like with ob_start(), the order of output handler is important for proper output. For example, user must register ob_gzhandler before session start.
Notes
Note: If you are using cookie-based sessions, you must call session_start() before anything is outputted to the browser.
so what does this all mean really.
ok, i will try to explain more simple.
lets say i have a script that looks like this:
<?php
echo 'hello wallpaperama';
session_start();
?>
echo 'hello wallpaperama';
session_start();
?>
Ally Fri May 18, 2012
<? session_start() so helpful to me,thanks a lot.
sam Wed Apr 18, 2012
nice .........thanks
fuzzyhead Tue Apr 03, 2012
Thanks a lot you're the best.
abeera Wed Mar 28, 2012
I was facing the same issue at jobs111 dot com and at ysapak dot com
But after shifting session_start() at line1 the issue was resolved. Thanks a lot
But after shifting session_start() at line1 the issue was resolved. Thanks a lot
Salma Mon Mar 12, 2012
I am facing these errors :(
Warning: session_start() [function.sessi Cannot send session cookie - headers already sent by (output started at /home/eitlabs1/ in /home/eitlabs1/ on line 423
Warning: session_start() [function.sessi Cannot send session cache limiter - headers already sent (output started at /home/eitlabs1/ in /home/eitlabs1/ on line 423
Warning: Cannot modify header information - headers already sent by (output started at /home/eitlabs1/ in
Warning: session_start() [function.sessi Cannot send session cookie - headers already sent by (output started at /home/eitlabs1/ in /home/eitlabs1/ on line 423
Warning: session_start() [function.sessi Cannot send session cache limiter - headers already sent (output started at /home/eitlabs1/ in /home/eitlabs1/ on line 423
Warning: Cannot modify header information - headers already sent by (output started at /home/eitlabs1/ in
gigi Tue Feb 07, 2012
it was really helpful.
shishir Tue Jan 31, 2012
Hello , i am facing a problem with joomla
Warning: session_start() [function.sessi Cannot send session cookie - headers already sent by (output started at /home/alalamia/ in /home/alalamia/ on line 370
Warning: session_start() [function.sessi Cannot send session cache limiter - headers already sent (output started at /home/alalamia/ in /home/alalamia/ on line 370
Warning: Cannot modify header information - headers already sent by (output started at /home/alalamia/ in /home/alalamia/ on line 372
Warning: session_start() [function.sessi Cannot send session cookie - headers already sent by (output started at /home/alalamia/ in /home/alalamia/ on line 370
Warning: session_start() [function.sessi Cannot send session cache limiter - headers already sent (output started at /home/alalamia/ in /home/alalamia/ on line 370
Warning: Cannot modify header information - headers already sent by (output started at /home/alalamia/ in /home/alalamia/ on line 372
varsha Wed Jan 11, 2012
thanx, this solution helped me...
ARUN Wed Jan 04, 2012
HELPED ME A LOT
vivek Thu Nov 10, 2011
Thanks bro.......
tariqul Thu Nov 03, 2011
dear I use session start() ,then it shows the following warning massage
session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at H:\xampp\htdocs\login_suc in H:\xampp\htdocs\login_suc on line 4
what can I do now?
session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at H:\xampp\htdocs\login_suc in H:\xampp\htdocs\login_suc on line 4
what can I do now?
anant Wed Aug 24, 2011
Thanks it helped me too..
THIS Sun Aug 14, 2011
in order to protect this kind of agly error you have to put the php session_start() function in head of ur code.....
<? session_start();?>
<html> rest of ur php and html code goes in here
.
</html
<? session_start();?>
<html> rest of ur php and html code goes in here
.
</html
2pac Sat Aug 13, 2011
helped a ltot
walkrie Fri Aug 05, 2011
Little info you've put here has absolutely saved my life, thank you so much
Related Content
Information
Forums »
PHP Forums And Topics Discussions About Hyper Text Programming Language »
Warning: Session_start() [function.session-start]: Cannot Send Session
PHP Forums And Topics Discussions About Hyper Text Programming Language »
Warning: Session_start() [function.session-start]: Cannot Send Session
Title: Warning: Session_start() [function.session-start]: Cannot Send Session
Description: this article will try to explain why you are getting a php error that says Warning: session_start() [function.session-start]: Cannot send session
Tags: warning ,session ,start ,functionsession ,start ,cannot ,send ,session
Info: This Post Has Been Viewed 0 Times Since
Date: Mon Sep 25, 2006
Author hostman Received 52 Replies #964
Date: Mon Sep 25, 2006
Author hostman Received 52 Replies #964
Share
URL: 

Embed: 

To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it
BBCODE:: 

BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
wallpaperama | Wallpapers | Forums | Terms Of Service
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5