Issue with edit profile page

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

By MatrixHyperLoop - March 20, 2015

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/

By MatrixHyperLoop - March 22, 2015

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.

By degreesnorth - May 19, 2015

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

By Dave - May 21, 2015

Hi there,

When I go to that url the page seems to keep reloading?  You may have a redirect loop? 

If there's any code that redirects make sure you've got an exit; after the redirect line.

Also I don't see any header error messages when I search for "header" in the view-source?

Let me know, thanks!

Dave Edis - Senior Developer
interactivetools.com