#96621Visiting the workspace preview of a page makes all pages "workspace version" even without the "?ADMCMD_prev=..." part
Description
Premise: tested on TYPO3 12.0.0-dev, but it should affects also lesser versions (10,11)
Prerequisites
- TYPO3 installation, fresh
- A draft workspace
- use admin user, is good as well
Steps to reproduce
On LIVE workspace
1. Create a page “test“
2. switch to draft workspace and go to “test“
3. Create a content element and save it
4. Go to the workspace module and generate the preview link
5. Log out from TYPO3 or open a new browser window in incognito mode or change browser
6. Visit the preview link given to you
Issue description
- If I visit the link for the generated workspace, for example:
https://typo3.whatever/test?ADMCMD_prev=246e0166ff13bd8f265e7e0060a50806
I see the draft workspace version – the one with the yellow box on the right upper corner – and the content element is of course visible
- If I visit the same link (on the same browser) , but the LIVE version i.e.
https://typo3.whatever/test
I still see the workspace version with the yellow box. This is true for every other page of the site.
It is possible to use the “stop preview” to obtain the message that we “log out from Workspace preview mode.” with the link of the same page, live version.
I suspect that the responsible is the ADMCMD_prev cookie (a session cookie if I am not wrong)… I guess it is set when I visit the workspace link and remains valid for the whole site, until you remove it.
Additional notes
Not tested with multiple sites on the same installation
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 2
History 5
-
Riccardo De Contardi changed Related to #75063 <span data-processor="relativetime" data-value="2022-01-22T17:34:34+00:00" > 01/22/22, 17:34 </span>
-
Oliver Hader commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2022-01-24T07:52:55+00:00" > 01/24/22, 07:52 </span> -
Riccardo De Contardi commented <span data-processor="relativetime" data-value="2022-01-24T09:21:21+00:00" > 01/24/22, 09:21 </span>
Oliver Hader wrote in #note-2:
> Thus, the system cannot determine automatically when the workspace preview shall be ended. That’s the reason for having that “logout” button which actually drops the corresponding cookie and terminated the virtual backend user session. The behavior is not new, but at least exists since TYPO3 v6.2.
I understand; The odd behavior is that the preview is triggered also without the
ADMCMD_prevpart.Also, when in workspace I read “generate preview link” I would expect that it should be valid only for that link
So, in my opinion there are two sources of confusion:
1) the “virtual backend user session” continues without the
?ADMCMD_prev=[value]part
2) the link is actually a “preview version” of the whole workspace, not only of the single page> […]. Adding
?ADMCMD_prev=[value]to each link in the frontend preview is not a good solution, since those links might be copy&pasted, allowing others to get the workspace preview or at least a strange frontend experience (having that “logout” button or similar)IIRC the link is valid for 1h
Correct me if I am wrong; the whole point of the “generate preview link” is to have an easy tool to generate a preview link that can be copied and pasted and sent to people that don’t have access to the CMS
> Examples for a preview trigger:
>
> * https://preview.example.org/some/page →previewsubdomain explicitly states workspace preview mode
> * https://example.org/_preview/some/page →_previewprefix explicitly states workspace preview mode
> ** potential conflicts with other route configuration needs to be considered
> ** e.g. segments starting with_(or similar) might be declared as “system-internal” in TYPO3 v12If I’ve understood it, a solution like
https://preview.example.org/some/pagewould mean that an alternative domain should be set in the site config (the yaml file I mean) and tied to the workspace.
Correct me if I am wrong, but that would be still a preview for the whole workspace. -
Riccardo De Contardi changed Related to #102527 <span data-processor="relativetime" data-value="2025-03-28T11:31:31+00:00" > 03/28/25, 11:31 </span>
-
Benni Mack commented and changed status
Needs FeedbackClosed <span data-processor="relativetime" data-value="2026-11-19T13:51:50+00:00" > 11/19/26, 13:51 </span>I checked this against the current main branch, and the behaviour is still the same, but it is intended:
- A workspace preview link is a preview of the whole workspace, not of a single page. The
sys_previewrecord only stores the workspace, the page in the URL is just the entry point. - When visiting a valid
?ADMCMD_prev=…link, TYPO3 sets anADMCMD_prevsession cookie for the site path. Further requests without the parameter use this cookie, which is what allows navigating through the preview by clicking regular links. - The preview ends when the browser session ends, when the preview link expires, or when “Stop preview” is used, which removes the cookie.
As Oliver explained, adding the parameter to every generated link is not an option, since copied links would leak the preview. A dedicated preview domain or URL prefix (e.g.
preview.example.orgor/_preview/) could make the preview mode more explicit, but that would be a new feature and should get its own issue.I’m closing this issue, as the behaviour works as intended. Feel free to open a feature request for an explicit preview domain/prefix if needed.
- A workspace preview link is a preview of the whole workspace, not of a single page. The
Using a workspace preview link containing
ADMCMD_prevcreates a virtual backend user session, which is stored in a cookie. This allows to navigate (click other links) in a workspace preview and still seeing their workspace contents (if any).Thus, the system cannot determine automatically when the workspace preview shall be ended. That’s the reason for having that “logout” button which actually drops the corresponding cookie and terminated the virtual backend user session. The behavior is not new, but at least exists since TYPO3 v6.2.
Alternatives would be a preview domain or preview URL segment. Adding
?ADMCMD_prev=[value]to each link in the frontend preview is not a good solution, since those links might be copy&pasted, allowing others to get the workspace preview or at least a strange frontend experience (having that “logout” button or similar).Examples for a preview trigger:
previewsubdomain explicitly states workspace preview mode_previewprefix explicitly states workspace preview mode_(or similar) might be declared as “system-internal” in TYPO3 v12