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

Stage and Live modes; does a cookie get saved?


Go to End


5 Posts   1997 Views

Avatar
dynamite

Community Member, 66 Posts

3 September 2009 at 5:36am

Hello,

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?

http://localhost/new-page/?stage=Stage&savestate=false

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.

Thanks!

Jeremy

Avatar
Willr

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.

Avatar
dynamite

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

Avatar
Willr

Forum Moderator, 5523 Posts

4 September 2009 at 8:57am

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

Avatar
merrick_sd

Community Member, 99 Posts

6 April 2013 at 2:39am

http://mydomain.co.uk?stage=Stage

<% if current_stage == "Stage" %>

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

ESLE do that
<% end_if %>

YES is always true even if i do http://mydomain.co.uk
result //Live Yes do this

something wrong with my if syntax