Page MenuHomePhabricator

Add confirmation step to exit session flow for temp accounts
Closed, ResolvedPublic

Assigned To
Authored By
KColeman-WMF
Nov 1 2024, 11:39 AM
Referenced Files
F65802856: image.png
Aug 20 2025, 3:41 PM
F65788221: image.png
Aug 19 2025, 2:44 PM
F65788313: image.png
Aug 19 2025, 2:44 PM
F65788162: image.png
Aug 19 2025, 2:44 PM
F65778011: image.png
Aug 18 2025, 1:48 PM
F65750946: image.png
Aug 14 2025, 1:39 PM
F57666516: Exit flow.png
Nov 1 2024, 11:39 AM

Description

Background

The exit/log out flow for a temporary user should include a confirmation step. When the temporary user clicks 'Exit session' a dialog should appear, prompting the user to confirm if they wish to exit and log out, and making it clear that there will be no way to log back into their temporary account.

User story

As a temporary user, I want to understand what will happen if I choose to exit a session, so that I can make an informed choice before logging out.

Requirements
  • Dialog launches when temp user clicks 'Exit session' in user profile menu
  • Copy explains what will happen if temp user exits session
  • Temp user can Cancel dialog or continue to Log out
Design

Figma file

Exit flow.png (1×4 px, 506 KB)

Copy
Dialog titleDialog body textDialog buttons
Exit sessionIf this is not a shared device, you do not need to exit your session. Once you log out, you will no longer be able to access this temporary account. Please be aware that creating multiple temporary accounts to continue editing may be against the rules of this wiki and you could be blocked if this happens frequently. Are you sure you want to end this session and log out?Cancel, Log out

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

It can instead be linked to Special:UserLogout which will display a confirm page. Note clicking the logout link in personal toolbar send a POST request which will log out user directly (cf T25227/geerit 504565 which introduced this confirm page and gerrit 506386 which turns logout link to POST request).
T357484: Implement Logout Confirmation will add a preference to allow user to go to confirm page instead of log out directly when clicking logout link. We can reuse it, just require all temp users to use confirm page. Currently we already have a custom confirm message in Special:UserLogout for temp account so we don't need to make a new one.

It can instead be linked to Special:UserLogout which will display a confirm page. Note clicking the logout link in personal toolbar send a POST request which will log out user directly (cf T25227/geerit 504565 which introduced this confirm page and gerrit 506386 which turns logout link to POST request).
T357484: Implement Logout Confirmation will add a preference to allow user to go to confirm page instead of log out directly when clicking logout link. We can reuse it, just require all temp users to use confirm page. Currently we already have a custom confirm message in Special:UserLogout for temp account so we don't need to make a new one.

We are already linking to Special:UserLogout. We just need to disable the code that uses JS to log the user out, AFAICT. As @Bugreporter notes, we made some changes to the confirm message in T374519: When a temporary user clicks on "Exit session" the resulting success page says they "are now logged out". I think what we need to do is allow the user to continue to Special:UserLogout if they have a temporary account, rather than invoking the JS based logout method.

@KColeman-WMF Is there a deadline/due date for when you folks need this done?

@KColeman-WMF Is there a deadline/due date for when you folks need this done?

I don't think we have a specific deadline. We are aiming for wider deployments beginning in May, so ideally before then. cc @Tchanders @Niharika

@KColeman-WMF Is there a deadline/due date for when you folks need this done?

I don't think we have a specific deadline. We are aiming for wider deployments beginning in May, so ideally before then. cc @Tchanders @Niharika

I think @Niharika is probably best placed to answer this. Should it be tagged as a blocker?

@KColeman-WMF Is there a deadline/due date for when you folks need this done?

I don't think we have a specific deadline. We are aiming for wider deployments beginning in May, so ideally before then. cc @Tchanders @Niharika

I think @Niharika is probably best placed to answer this. Should it be tagged as a blocker?

My 2c, I don't think this needs to block anything. If we make a change to the exit session flow at some point in the future, that won't really impact existing / new temporary account users that much.

I do think it's important that we give temp users the additional information / context before they log out. Especially as this is a new feature that many users will be unfamiliar with. So I agree that ideally we have this in place before wider deployment.

Agree that it is ideal to have this in place before May. But I do not think we should make this a hard blocker for our rollout.

@JScherer-WMF what's your team's timeline for working on this?

I was thinking about this today--maybe "Exit session" should be more prominent, and also act instantly (without a confirmation step) for users who make an edit on a shared device and don't want their edit history to be readily available to others with access to that device.

@Dragoniez @KColeman-WMF @Dreamy_Jazz I've updated the wording on the confirmation dialog to be more aligned with what Japanese Wikipedia came up with in their community discussion:

If this is not a shared device, you do not need to exit your session. Once you log out you will no longer be able to access this account. Please be aware that creating multiple accounts for editing can be considered as sock puppetry and you may be blocked if this happens frequently. Are you sure you want to exit this session and log out?

Thoughts on this wording?

@Dragoniez @KColeman-WMF @Dreamy_Jazz I've updated the wording on the confirmation dialog to be more aligned with what Japanese Wikipedia came up with in their community discussion:

If this is not a shared device, you do not need to exit your session. Once you log out you will no longer be able to access this account. Please be aware that creating multiple accounts for editing can be considered as sock puppetry and you may be blocked if this happens frequently. Are you sure you want to exit this session and log out?

Thoughts on this wording?

The text about sockpuppetry might be confusing, because it's a term that I don't think new users would understand. Could we consider not referring to the term "sockpuppetry" and instead word it differently?

Also, the user is using temporary accounts and not specifically accounts, so perhaps we should update that phrase too?

An example I'd suggest for that sentence: "Please be aware that creating multiple temporary accounts for editing can be against the rules of this wiki and you may be blocked if this happens frequently"

@Niharika @Dreamy_Jazz Thank you for the update!

I suggest explicitly referring to “temporary accounts” instead of just “accounts”, because the interfaces for registered and temporary accounts are similar (though not identical). Otherwise, people might mistakenly think they shouldn’t log out of a registered account after creating one.

I also agree with Dreamy_Jazz about the term “sockpuppetry,” so here’s my suggestion:

If this is not a shared device, you do not need to exit your session. Once you log out, you will no longer be able to access this temporary account. Please be aware that creating new temporary accounts to continue editing after logging out may violate this wiki’s rules, and you could be blocked if this happens frequently. Are you sure you want to end this session and log out?

Thanks @Dragoniez and @Dreamy_Jazz. Made a couple small tweaks:
If this is not a shared device, you do not need to exit your session. Once you log out, you will no longer be able to access this temporary account. Please be aware that creating multiple temporary accounts to continue editing may be against the rules of this wiki and you could be blocked if this happens frequently. Are you sure you want to end this session and log out?

I wonder if we can make the reason for exiting a session even clearer? And we could use a notice message to encourage users to stop and double check before clicking log out?

image.png (924×1 px, 128 KB)

Editing on a shared device
If you are editing on a shared device like a library or school computer, you can exit this session to prevent other people from using this temporary account.

Please be aware that editing with multiple temporary accounts may be against the rules of this wiki and you could be blocked if this happens frequently.

Are you sure you want to exit this session and log out?
Once you log out, you will no longer be able to access this temporary account.

@KColeman-WMF I like the idea overall.

Editing on a shared device

Seeing this header makes me feel like the software has detected that I am on a shared device. I suggest we drop this header and keep the rest as is.

@KColeman-WMF I like the idea overall.

Editing on a shared device

Seeing this header makes me feel like the software has detected that I am on a shared device. I suggest we drop this header and keep the rest as is.

+1 to this

I wonder if we can make the reason for exiting a session even clearer? And we could use a notice message to encourage users to stop and double check before clicking log out?

image.png (924×1 px, 128 KB)

Editing on a shared device
If you are editing on a shared device like a library or school computer, you can exit this session to prevent other people from using this temporary account.

Please be aware that editing with multiple temporary accounts may be against the rules of this wiki and you could be blocked if this happens frequently.

Are you sure you want to exit this session and log out?
Once you log out, you will no longer be able to access this temporary account.

We have specific message for temporary accounts displayed in Special:UserLogout (https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/specials/SpecialUserLogout.php$146), so we do not need a dialog - instead we can just redirect them to Special:UserLogout and disable auto-logout js (see T378806#10287658).

We have specific message for temporary accounts displayed in Special:UserLogout (https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/specials/SpecialUserLogout.php$146)

What you linked is the success message AFAICS, so would only be shown once the logout is complete.

instead we can just redirect them to Special:UserLogout and disable auto-logout js

There may be unintended consequences for that. A user would end up not being on the page they pressed "Exit session" on, which the dialog would do.

IMO the dialog approach would be preferred if that doesn't raise server load concerns, because I don't think everyone necessarily reads "interface messages". There are quite a few auxiliary texts on special pages but I doubt if everyone reads them all (I don't). A modal dialog would explicitly tell the user to "read this" as it naturally draws the user's attention to the dialog per se.

@KColeman-WMF I like the idea overall.

Editing on a shared device

Seeing this header makes me feel like the software has detected that I am on a shared device. I suggest we drop this header and keep the rest as is.

+1 to this from me as well

If user disabled JavaScript, then the dialog will not show and user is redirected to Special:UserLogout. So the message <userlogout-temp> should still be useful.

If user disabled JavaScript, then the dialog will not show and user is redirected to Special:UserLogout. So the message <userlogout-temp> should still be useful.

Yes, agreed. We would likely customise the text of userlogout-temp to be at least most of what is shown in the dialog.

IMO the dialog approach would be preferred if that doesn't raise server load concerns, because I don't think everyone necessarily reads "interface messages". There are quite a few auxiliary texts on special pages but I doubt if everyone reads them all (I don't). A modal dialog would explicitly tell the user to "read this" as it naturally draws the user's attention to the dialog per se.

I understand the concern that users might not read all messages (I do the same myself!), but on a special page where there is only a message and a button, I'd suspect the user would be more likely to read the message.

It can instead be linked to Special:UserLogout which will display a confirm page. Note clicking the logout link in personal toolbar send a POST request which will log out user directly (cf T25227/geerit 504565 which introduced this confirm page and gerrit 506386 which turns logout link to POST request).
T357484: Implement Logout Confirmation will add a preference to allow user to go to confirm page instead of log out directly when clicking logout link. We can reuse it, just require all temp users to use confirm page. Currently we already have a custom confirm message in Special:UserLogout for temp account so we don't need to make a new one.

We are already linking to Special:UserLogout. We just need to disable the code that uses JS to log the user out, AFAICT. As @Bugreporter notes, we made some changes to the confirm message in T374519: When a temporary user clicks on "Exit session" the resulting success page says they "are now logged out". I think what we need to do is allow the user to continue to Special:UserLogout if they have a temporary account, rather than invoking the JS based logout method.

This seems like a sensible approach to me.

IMO the dialog approach would be preferred if that doesn't raise server load concerns, because I don't think everyone necessarily reads "interface messages". There are quite a few auxiliary texts on special pages but I doubt if everyone reads them all (I don't). A modal dialog would explicitly tell the user to "read this" as it naturally draws the user's attention to the dialog per se.

Yes, I agree that the intention here is to interrupt the flow (hence the use of a dialog) and ask the user to confirm if they want to continue.

Change #1179165 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/core@master] SpecialUserLogout: Improve the warning shown to temporary users

https://gerrit.wikimedia.org/r/1179165

Change #1179166 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/core@master] Show confirmation dialog to temporary users on logout attempt

https://gerrit.wikimedia.org/r/1179166

IMO the dialog approach would be preferred if that doesn't raise server load concerns, because I don't think everyone necessarily reads "interface messages". There are quite a few auxiliary texts on special pages but I doubt if everyone reads them all (I don't). A modal dialog would explicitly tell the user to "read this" as it naturally draws the user's attention to the dialog per se.

I understand the concern that users might not read all messages (I do the same myself!), but on a special page where there is only a message and a button, I'd suspect the user would be more likely to read the message.

Yes, I agree that the intention here is to interrupt the flow (hence the use of a dialog) and ask the user to confirm if they want to continue.

I agree that interrupting the flow is what is needed here, though it seems to me as though the page redirect also interrupts the flow, since the logout can't continue without the user clicking another button.

Technical investigation

@Niharika asked me to investigate the difficulty of this task.

Here are the things we could do, and what it involves technically:

  1. Improve the message in Special:UserLogout to match the task description. This is done in https://gerrit.wikimedia.org/r/1179165 and seems worth doing regardless of whatever else we do.
  2. Simply redirect to Special:Logout on clicking the exit link. This would be very little work - it would just involve updating logoutViaPost to return early for temporary accounts.
  3. Add a dialog. This is relatively straightforward using a utility function in OOUI for showing a dialog, then choosing a reaction based on which button was clicked - implemented in https://gerrit.wikimedia.org/r/1179166. (I'm looking into how this can be done using Codex, but I'm not aware of a similar utility.) If JavaScript is not available, the redirect to Special:UserLogout will go ahead, and the user will still see the same warning (as long as we do (1)) and will need to click again to logout (status quo).

I'm happy to go ahead with option 3 with an OOUI dialog since it seems simple and better user experience than redirecting them elsewhere.
@KColeman-WMF does that sound good to you?

I'm happy to go ahead with option 3 with an OOUI dialog since it seems simple and better user experience than redirecting them elsewhere.
@KColeman-WMF does that sound good to you?

Which OOUI dialog would we be using? Are we able to change the width of "message dialog with 2 actions", and use Codex design tokens for font size in the body copy (font-size-small), and a notice icon in the message?

I think the default is too small/tight on desktop but otherwise it could work.

image.png (1×2 px, 1 MB)

How does this look on Minerva e.g. mobile web?
The screenshots seem to be for desktop but the core code should be running there as well.

OKryva-WMF raised the priority of this task from Medium to High.Aug 19 2025, 11:19 AM

Here are some screenshots of how this could look:

Special:UserLogout
image.png (319×1 px, 34 KB)
OOUI dialog on desktop (medium size)
image.png (904×1 px, 112 KB)
OOUI dialog on mobile (small size)
image.png (914×427 px, 82 KB)

Thanks, this looks good to me!

Just a couple of design changes:

  • Special:UserLogout button can use the same CTA copy, i.e. Log out rather than Submit.
  • Can we add a small amount of spacing around the message component so it's less tight?

image.png (1×690 px, 147 KB)

And this is the agreed copy to use:

If you are editing on a shared device like a library or school computer, you can exit this session to prevent other people from using this temporary account.

Please be aware that editing with multiple temporary accounts may be against the rules of this wiki and you could be blocked if this happens frequently.

Are you sure you want to exit session and log out?
Once you log out, you will no longer be able to access this temporary account.

Change #1180828 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/core@master] SpecialUserLogout: Update label on submit button

https://gerrit.wikimedia.org/r/1180828

Change #1179165 merged by jenkins-bot:

[mediawiki/core@master] SpecialUserLogout: Improve the warning shown to temporary users

https://gerrit.wikimedia.org/r/1179165

Change #1179166 merged by jenkins-bot:

[mediawiki/core@master] Show confirmation dialog to temporary users on logout attempt

https://gerrit.wikimedia.org/r/1179166

Change #1180828 merged by jenkins-bot:

[mediawiki/core@master] SpecialUserLogout: Update label on submit button

https://gerrit.wikimedia.org/r/1180828

Djackson-ctr subscribed.

New Code Changes have been implemented and verified Per the Requirements in the ticket Description...

Note: the Dialog Body Text in the ticket description is out dated and the new Dialog Body Text is:

If you are editing on a shared device like a library or school computer, you can exit this session to prevent other people from using this temporary account.

Please be aware that editing with multiple temporary accounts may be against the rules of this wiki and you could be blocked if this happens frequently.

Are you sure you want to exit session and log out?
Once you log out, you will no longer be able to access this temporary account.

QA was completed for this ticket using LocalHost: Mediawiki 1.45.0-alpha (0713c73)...

Testing was performed on various: Skins, Desktop View/MobileView, Chrome/Edge/Firefox/Safari, Windows/Mac/Android/iOS, RTL languages.