Closed Thread
Thread Tools Search this Thread
Unread 21st Sep 2010, 11:32 AM   #1
phu
Active Warrior
War Room Member
 
Join Date: 2008
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Error message session_start() [function.session-start]: Cannot send session
Share on: 
fb share twitter share gplus share more share

hello,

Can someone suggest why I get this eror message on my webpage at the top. Below is error message. I would appreciate how to tale action on removing the error.


Warning
: session_start() [ function.session-start ]: Cannot send session cache limiter - headers already sent (output started at /home/gizmo168/public_html/example.com/testimonials.php:2) in /home/gizmo18/public_html/example.com/testimonials.php on line 3

I tried everything to resolve but I cant get rid of the error.

Thank You

Last edited on 21st Sep 2010 at 11:37 AM. Reason: spelling eror
phu is offline  
Unread 21st Sep 2010, 11:43 AM   #2
HyperActive Warrior
War Room Member
 
CarloD.'s Avatar
 
Join Date: 2009
Location: Thunder Bay ON
Posts: 403
Thanks: 14
Thanked 47 Times in 40 Posts
Default
Re: Error message session_start() [function.session-start]: Cannot send session
Share on: 
fb share twitter share gplus share more share

your script is trying to do something after the headers have been sent... this needs to be done before they are sent.... that what the error means.

what is this script for? what does it do?

CarloD. is offline  
Unread 21st Sep 2010, 12:33 PM   #3
phu
Active Warrior
War Room Member
 
Join Date: 2008
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: Error message session_start() [function.session-start]: Cannot send session
Share on: 
fb share twitter share gplus share more share

hello,

thankyou for your help. Its a review script from Commentics - A free PHP comments script

I use trellian site builder to edit html pages.
phu is offline  
Unread 21st Sep 2010, 12:40 PM   #4
Totally Awesome GirlCoder
 
gfsocial's Avatar
 
Join Date: 2010
Posts: 54
Thanks: 4
Thanked 2 Times in 2 Posts
Default
Re: Error message session_start() [function.session-start]: Cannot send session
Share on: 
fb share twitter share gplus share more share

This is a common error... you likely have code or a white space before the session start command..

The RULE is you cannot have anything before the session_start(); NOT ONE CHARACTER, otherwise, the browser thinks the webpage has already started, so before you start session_start(); YOU CANNOT START THE HEADER. You start the header with any character, this includes white spaces (space bar)....

it current is on line 3 i think it says above.. move it to the VERY start of line one..

gfsocial is offline  
Unread 21st Sep 2010, 01:24 PM   #5
phu
Active Warrior
War Room Member
 
Join Date: 2008
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: Error message session_start() [function.session-start]: Cannot send session
Share on: 
fb share twitter share gplus share more share

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<?php
session_start();
ob_start();
?><HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"><LINK
href="comments/css/stylesheet.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.6000.17080" name=GENERATOR></HEAD>
<BODY oncontextmenu="return false;"

I have removed this line here but it still shows the same error message on browser. This line still shows up when i got to source code on the browser.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
phu is offline  
Unread 21st Sep 2010, 01:42 PM   #6
Warrior Member
 
Join Date: 2010
Posts: 22
Thanks: 6
Thanked 2 Times in 2 Posts
Default
Re: Error message session_start() [function.session-start]: Cannot send session
Share on: 
fb share twitter share gplus share more share

Move

<?php
session_start();
ob_start();
?>

to the top of the page. It needs to be before any output or any HTML.
BillLudwig is offline  
Unread 21st Sep 2010, 02:01 PM   #7
phu
Active Warrior
War Room Member
 
Join Date: 2008
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: Error message session_start() [function.session-start]: Cannot send session
Share on: 
fb share twitter share gplus share more share

i have move this right to the top. and the error still shows.

<?php
session_start();
ob_start();
?><HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"><LINK
href="comments/css/stylesheet.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.6000.17080" name=GENERATOR></HEAD>

Has it got to do with my website builder treillian. when i remove the top line here -

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

this line, it goes back to where it was at the top when i go to source code from browser.

Last edited on 21st Sep 2010 at 02:25 PM. Reason: add more details
phu is offline  
Unread 21st Sep 2010, 03:15 PM   #8
Totally Awesome GirlCoder
 
gfsocial's Avatar
 
Join Date: 2010
Posts: 54
Thanks: 4
Thanked 2 Times in 2 Posts
Default
Re: Error message session_start() [function.session-start]: Cannot send session
Share on: 
fb share twitter share gplus share more share

Originally Posted by phu View Post

Has it got to do with my website builder treillian. when i remove the top line here -
yup... thats likely what is going on.. you need to edit this manually if need be.. use note pad?

gfsocial is offline  
Unread 21st Sep 2010, 03:18 PM   #9
phu
Active Warrior
War Room Member
 
Join Date: 2008
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: Error message session_start() [function.session-start]: Cannot send session
Share on: 
fb share twitter share gplus share more share

ah yes, i just fixed it. I use notepad++ to encode it to utf 8 without bom. then save as and ftp.

error script gone. what a whole day spent on trying to get rid of this error.

thanks anyway. hope this thread helps!
phu is offline  
Unread 21st Sep 2010, 03:42 PM   #10
Bert
 
dealbert.net's Avatar
 
Join Date: 2010
Location: Pasadena, CA
Posts: 29
Thanks: 0
Thanked 4 Times in 4 Posts
Default
Re: Error message session_start() [function.session-start]: Cannot send session
Share on: 
fb share twitter share gplus share more share

Use this at the beginning of your script.

if(!session_id()){ session_start();}
dealbert.net is offline  
Closed Thread


Bookmarks

Tags
error, functionsessionstart, message, send, session, sessionstart

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 08:57 AM.