According to this idea here: https://community.sdl.com/ideas/sdl-tridion-dx-ideas/i/sdl-tridion-sites-ideas/proper-mechanism-for-easily-detecting-xpm-mode-in-dxa---server-side DXA 2.2 has a
WebRequestContext.IsSessionPreview
property and it should determine if the request came from XPM. I took a peek at the DXA 2.2 source and the property uses the preview-session-token
cookie and the x-preview-session-token
header.
The cookies set when launching XPM are the following:
When using the preview feature(as in the Update Preview button) the cookies are:
So as you can see, the cookie is not set when starting XPM and therefore cannot be used to determine if XPM is active. Note that this is Tridion 9 and DXA 2.1.
My questions are:
1. Is my assumption right? Am I missing something?
2. Can the cookie be configured to appear at XPM launch time? If yes, where?
3. Has this behavior changed in Tridion 9.1?