Jump to:

22975 Posts in 11620 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Homepage controller cookie not set

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 675 Views
  • PeltierEffects
    Avatar
    Community Member
    6 Posts

    Homepage controller cookie not set Link to this post

    Okay, on my page controller I set a cookie to pass information. But when someone enters via the homepage no cookie gets set. Not even the SS pastmember cookie. So it's not just my cookie, not cookie gets set on the visitor entering the site on the homepage. Entering on any other page all cookies get set no problem, even the SS pastmember cookie is good.

    I've debugged the code an see the set cookie is getting executed but no cookie. Again entering on another page with the indentical cookie code works well.

  • PeltierEffects
    Avatar
    Community Member
    6 Posts

    Re: Homepage controller cookie not set Link to this post

    Okay, figured it out on an Ah Ha moment

    At the top of the HomePage.php was a blank line before <?php

    You can't do that. There must be NO output before the setcookie and a blank line is output. Normally you'd get a big error, but silverstripe hides the setcookie errors.

    675 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.