Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Silverstripe and Cookies


Go to End


2 Posts   822 Views

Avatar
woolyg

Community Member, 2 Posts

9 November 2011 at 9:18pm

Hi all,

In the PHP doco, it states that once a cookie is set, it can only be retrieved after the page/browser reloads.
(Source: http://php.net/manual/en/function.setcookie.php)

Are cookies in SS the same? ie. If I set one say in a controller, and the page loads, will it take a reload for the cookie data to be retrieved?

Please advise - I am a complete & total noob to SS.

Regards
WoolyG

Avatar
Willr

Forum Moderator, 5523 Posts

10 November 2011 at 8:55pm

Test it and see what happens! If that's what setcookie() requires then it's likely it will be the same as SilverStripe. Cookie in SilverStripe is simply a basic wrapper around setcookie