Issue with edit profile page

7 posts by 4 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: May 21, 2015   (RSS)

Hey guys I am working on a edit-profile page with the membership plugin and am getting this error when I save.

setPrefixedCookie: Can't set cookie, headers already sent!

What do you think this could be?

By Damon - March 21, 2015

Hi,

Cookies and session data need to be sent before any content.  

The usual cause of the "headers already sent" error is extra whitespace before, after, or between tags.  Check on line 4 of /user-login.php for anything like that and remove it if possible.

Then check your include files before whitespace before the first <?php, after the last ?> or between tags, like this: 

?>
<?php

Replace with: ?><?php

Let me know if resolves the error message.

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

I started over again and seemed to have fixed it, I still am not quite sure what caused the error there wasn't any white spaces. Thanks for your help.

Hi Damon

I am getting this same error message and don't know what to do?

I've attached the file and you can see there's no white spaces.  It occurs in IE11, Chrome doesn't display the page and in Firefox the error message is in the header.

Any other ideas?

Thanks

Attachments:

contact.php 9K

By Dave - May 20, 2015

Hi degreesnorth, 

Which version of CMSB are you running?  Can you try upgrading to the latest version or changing this line in /lib/common.php:

function setPrefixedCookie($unprefixedName, $cookieValue, $cookieExpires = 0, $allowHttpAccessToHttpsCookies = false, $allowJavascriptAccess = false) {
  if (headers_sent($file, $line)) { die(__FUNCTION__ . ": Can't set cookie, headers already sent!  Output started in $file line $line.\n"); }

In the latest version the error should tell you the filename and line the whitespace is on.

Let me know what you find out,  thanks!

Dave Edis - Senior Developer
interactivetools.com

Hi David

I've changed the line as requested, and still the same error - eg. http://www.geneticalliance.org.au/contact.php

I am using the latest build.  This didn't used to happen with older builds, and there are NO white spaces.

I've attached the file again.

Any other ideas?

Attachments:

contact.php 9K