close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

error: cannot send session cookie.. already sent

Thread began 3/28/2011 7:09 am by James L | Last modified 3/29/2011 11:17 am by Jason Byrnes | 2186 views | 5 replies |

James L

error: cannot send session cookie.. already sent

I've built several successful sites with eCart, but now I made a new one using the exact same code as before (just changed the names (like connBSM to connMSB), but when I load the first page I get this error message:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /Applications/MAMP/htdocs/ProRes_from_Bill/TMPTAIJRIRTDU.php:1) in /Applications/MAMP/htdocs/ProRes_from_Bill/WA_eCart/WA_eCart_Definition_PHP.php on line 465

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /Applications/MAMP/htdocs/ProRes_from_Bill/TMPTAIJRIRTDU.php:1) in /Applications/MAMP/htdocs/ProRes_from_Bill/WA_eCart/WA_eCart_Definition_PHP.php on line 465

This even happens when a use the tutorial and complete the BlueSky music sample.

What do I need to change?

Sign in to reply to this post

Jason ByrnesWebAssist

see the following post for details on the headers already sent error:
showthread.php?t=19285



where you report the issue at line 1, look mostly at the last 2 causes in post 1) virtual() function for includes 2) Unicode BOM Signature.

Sign in to reply to this post

James L

your answer not working

I followed the directions and checked 1) and 2) in your response, but I still get the same error messages (the same one twice). This is the error msg:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /Applications/MAMP/htdocs/ProRes_from_Bill/TMP5LMPITUS5.php:5) in /Applications/MAMP/htdocs/ProRes_from_Bill/WA_eCart/WA_eCart_Definition_PHP.php on line 465

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /Applications/MAMP/htdocs/ProRes_from_Bill/TMP5LMPITUS5.php:5) in /Applications/MAMP/htdocs/ProRes_from_Bill/WA_eCart/WA_eCart_Definition_PHP.php on line 465

I tried attaching a screen capture of the definition file so you can see what it looks like in that section (screen cap so you can see the line numbers), the "Manage Attachments" just gives me a blank window, so I'll copy and paste just the code (I added a label for line 465):

//Session Storage Functions
function Session_SaveCart() {
if (!session_id()) session_start();
$theCartString = "";
for ($n=0; $n<sizeof($this->Items); $n++) {
$countIt = 0;
if ($n!=0) {
$theCartString .= "§";
}
foreach ($this->Items[$n] as $m) {
if ($countIt != 0) $theCartString .= "|WAECART|";
$theCartString .= $m;
$countIt++;
}
}
$_SESSION[$this->CartName."_Items"] = $theCartString;
}

function Session_GetContent() {
*Line 465:* if (!session_id()) session_start();
$retArray = array();
if (isset($_SESSION[$this->CartName."_Items"]) && $_SESSION[$this->CartName."_Items"] != "") {
$theCartString = $_SESSION[$this->CartName."_Items"];
$theItemArray = explode("§",$theCartString);
for ($x=0; $x<sizeof($theItemArray); $x++) {
$theValueArray = explode("|WAECART|",$theItemArray[$x]);
$toExec = "new ".$this->CartName. "_ItemDefinition(";
for ($y=0; $y<sizeof($theValueArray); $y++) {
if ($y != 0) $toExec.=", ";
$toExec .= '"'.str_replace("\'","'",addslashes($theValueArray[$y])).'"';
}
eval("\$nextItem =".$toExec.");");
$retArray[sizeof($retArray)] = $nextItem;
}
}
return $retArray;
}


Thanks, Jim

Sign in to reply to this post

Jason ByrnesWebAssist

you also posted this as a response to the thread I linked to. See my reply there.
showpost.php?p=94828&postcount=3

Sign in to reply to this post

James L

Lines 4 & 5 look Ok to me...

<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
?>
<?php
//WA eCart Include
require_once("WA_eCart/ProResCart_PHP.php");
?>
<?php require_once('Connections/connProRes.php'); ?>
<?php
$ProResCart->GetContent();
?>

Sign in to reply to this post

Jason ByrnesWebAssist

looking at the code you pasted, it looks file to me too, but that's not what the error is saying.


my guess is a blank space at the end of line 4:
"?> "

but i cant say without seeing the actual code.


I would need you to send a copy of the page in a zip archive to examine the code.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...