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.

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

Stage and Live modes; does a cookie get saved?

Go to End

5 Posts   1893 Views


Community Member, 66 Posts

3 September 2009 at 5:36am


I was wondering if a cookie or session variable is being set when switching between Draft (aka Stage) and Live mode when viewing the site as a logged in admin?

If so, how I can call a a preview of a page without "switching" to that mode? For example, is there a special GET string I can add on the end like this?


I am guessing that this may take some poking around in the internals of SS, but wanted to throw it out there to the community and see if anyone else has run into a situation like this before.




Forum Moderator, 5523 Posts

3 September 2009 at 3:58pm

Yes it is stored in a cookie (or session). In order to switch page you must change the GET variable back to the 'live'. No built in way to override this cookie.


Community Member, 66 Posts

4 September 2009 at 12:43am

Thanks willr.

Could you point me in the right direction if I wanted to try and modify some of the core SS files to turn this off?

Thanks again! ...Jeremy


Forum Moderator, 5523 Posts

4 September 2009 at 8:57am

See the choose_site_stage() function in Versioned.php Line 577.


Community Member, 99 Posts

6 April 2013 at 2:39am

<% if current_stage == "Stage" %>

// $current_stage
//YES do this
<% else %>

ESLE do that
<% end_if %>

YES is always true even if i do
result //Live Yes do this

something wrong with my if syntax