Good logout button design comes down to three things. The label is plain, such as “Log out”, next to a recognizable exit icon. The button sits in a fixed spot in the account menu, where people find it without hunting.
The logout also happens instantly, asking for confirmation only when unsaved work is at stake. Everything else (session expiry messages, the screen after the click, accessibility) builds on those three choices.
In short: put the logout link at the end of the account menu and label it with words, not an icon alone. Log people out in one click, and save the confirmation dialog for the rare case where leaving would destroy something. When a session expires on its own, warn people before it happens and bring them back to the same page after they sign in again.
How a logout actually works
A short look at the mechanism explains most of the design rules.
When someone clicks “Log out”, the browser sends a request to the server. The server then ends the session, which means it forgets the token that proved who the user was. It also tells the browser to delete the session cookie, the small file that carried that token. Finally, it redirects the user to a public page.
If any link in that chain is weak, the button lies. Picture a logout that only hides the account menu in JavaScript. The session stays alive on the server, so anyone who presses the back button on a shared computer gets into the account.
The Open Worldwide Application Security Project (OWASP), a non-profit that publishes web security guidance, is clear on this point. Its Session Management Cheat Sheet states that the session must be invalidated on the server when the user logs out. So the visual design is only half the job, and you should agree on the other half with whoever builds the back end.

Logout button design basics: label, icon and style
The label carries most of the meaning. “Log out” and “Sign out” both work, so pick the one that mirrors your entry point. If the button at the top of the site says “Sign in”, the exit should say “Sign out”, because mixed pairs make people wonder whether they’re two different things. Microsoft’s Writing Style Guide recommends “sign in” and “sign out”, so that pair is a safe choice for products used alongside Windows and Office.
Spelling matters too. “Logout” written as one word is a noun (“the logout page”), while the action on a button is the verb, “Log out”, in two words. It’s a small detail, but careful copy is one of the signals that tells people a product is maintained.
Which icon means logout?
In our view, the clearest logout symbol is an arrow pointing out of a box or a door frame. The main open-source icon libraries ship it under predictable names:
- Material Symbols calls it
logout; - Font Awesome 6 calls it
right-from-bracket(it wassign-out-altin version 5); - Bootstrap Icons calls it
box-arrow-right.
Avoid the power symbol, the circle with a vertical line. On devices it means “turn off”, and people may fear it will shut down the app or lose their data. A door with an arrow or a generic “exit” arrow reads better. Whatever icon you choose, keep the text label next to it, because an arrow on its own can also mean “next”, “share” or “open in a new window”.
Visual weight
Logging out is a secondary action, so it shouldn’t look like your main call to action. A text link or a quiet ghost button is enough. Red is a poor default: it signals a destructive action such as deleting an account, and logging out destroys nothing. We’d keep red for the rare flows where leaving really discards data, and say so in words.
Where to put the logout link
People look for logout where they found their account. Its reliable home is therefore the account menu behind the avatar or the user’s name, usually in the top-right corner on desktop. Inside that menu, logout goes last, separated from settings by a divider.
Big platforms such as Facebook move options between redesigns, and people then ask where their logout went. Our advice for users is simple: open the menu behind your profile picture first and check its last items. Our advice for designers follows from it: don’t make people relearn where the exit is.
OWASP’s guidance adds a useful rule: the logout control should be visible and reachable from every page of the application, in the header or menu. A logout that only exists on the profile page fails that test.
| Product type | Where logout goes | Avoid |
|---|---|---|
| Website with member area | Account dropdown in the header, last item | A bare “Logout” text link that appears on public pages after login |
| Dashboard or admin panel | Bottom of the sidebar, or the user menu in the top bar | Putting it between navigation items, where it gets clicked by mistake |
| E-commerce account | Last entry in the “My account” navigation and in the header account menu | Hiding it only on the account page |
| Banking or health app | Always visible in the top bar, not buried in a menu | Relying on the timeout as the only way out |
| Mobile app | Bottom of the profile or settings screen | An icon-only logout in the tab bar |

Confirm or log out instantly?
Most of the time, logout should happen in one click. A generic “Are you sure you want to log out?” adds a step to an action that is easy to undo, since the user can simply sign in again. In our view, it also trains people to click “Yes” without reading, which weakens the dialogs that really matter.
Confirmation earns its place when logging out would destroy something. In that case, the dialog should name the loss rather than ask a vague question. vecteezy.com makes the same point with more data.
| Situation | Do this | Avoid |
|---|---|---|
| Nothing unsaved (most sites) | Log out instantly, then show a short “You’ve logged out” page | A confirmation dialog on every logout |
| Unsaved form or draft | “You have unsaved changes to ‘Q3 report’. Save before logging out?” with Save, Discard and Cancel | “Are you sure?” with no mention of what will be lost |
| Upload, export or payment in progress | Warn that the task will stop, or let it finish first | Cancelling the task silently |
| Full shopping cart | Log out instantly and keep the cart on the account for next time | Emptying the cart on logout |
| Banking-style app | Instant logout, no dialog, with a clear confirmation screen | Any step that slows down someone leaving a shared device |
Banking is the case where friction feels most tempting and is least justified. Someone who taps logout on a shared or public device wants out now, so speed is the security feature.
What users should see after the click
The page after logout is part of the design, and many products neglect it. A good logged-out screen does four things:
- it confirms the result in plain words, such as “You’ve logged out of your account”;
- it offers a “Log in again” link, for people who clicked by mistake or want to switch accounts;
- it doesn’t show cached account pages when someone presses the back button;
- on sensitive products, it reminds people to close the browser on a shared computer.
Switching accounts is a real use case, not an edge case. Families share laptops, and teams share a front-desk computer. If closing and reopening the app is the only way to change accounts, people notice, and they complain.
For the back-button problem, two HTTP headers do the work. The header Cache-Control: no-store on account pages stops the browser from keeping copies of them. The header Clear-Site-Data: "cache", "cookies", "storage" on the logout response asks the browser to delete what the site stored. MDN (Mozilla Developer Network) Web Docs documents both headers.
Products with several devices can also offer “Log out of all devices” in the security settings. It belongs there rather than in the everyday account menu, because it’s a recovery tool for a lost phone, not a daily action.

Session expiry messages that don’t frustrate returning users
Automatic logout after inactivity protects accounts, but a badly handled timeout is one of the most annoying moments in any product. Someone writes a long message, goes for a coffee, clicks “Send” and lands on a login page with their text gone. There’s a good explainer over at dreamstime.com.
The timeout length depends on risk. OWASP’s cheat sheet describes common idle timeouts of 2 to 5 minutes for high-value applications and 15 to 30 minutes for low-risk ones. A blog comment area doesn’t need banking rules, and a bank shouldn’t use blog rules.
Warn before the session ends
WCAG is the Web Content Accessibility Guidelines, the W3C standard most accessibility laws point to. Its criteria come in three levels: A (the minimum), AA (the usual legal target) and AAA (the strictest). Criterion 2.2.1 Timing Adjustable (level A) applies to time limits like session timeouts.
Under 2.2.1, users must be able to turn off, adjust or extend the limit. A common way is a warning that gives them at least 20 seconds to extend it with a simple action. The criterion has exceptions, notably when the time limit is essential or longer than 20 hours, so read the W3C explanation of 2.2.1 before deciding your case is exempt.
A good warning dialog says how long is left and offers one obvious button: “Your session will end in 2 minutes. Stay signed in”. It doesn’t block the page with jargon about tokens.
Bring people back to where they were
After an expired session, the login page should explain what happened (“You were signed out after 30 minutes of inactivity”) rather than show a bare form or an error. After signing in again, send people back to the page they were on, not to the home page or the dashboard.
WCAG 2.2.5 Re-authenticating (level AAA) goes further: when a session expires, users should be able to continue without losing data after signing in again. Saving drafts locally or on the server makes that possible. A step-by-step version exists if you prefer that format.
WCAG 2.2.6 Timeouts (also AAA) asks you to warn users how long inactivity can last before data is lost, unless the data is kept for more than 20 hours. AAA criteria aren’t usually required by law, but for forms that take time to fill, they’re simply good design.
Accessibility rules for the logout control
A logout control is small, so accessibility problems on it are easy to miss. Check these points:
- Accessible name. An icon-only button needs a text alternative under WCAG 1.1.1 Non-text Content, for example
aria-label="Log out". If a visible label exists, WCAG 2.5.3 Label in Name says the accessible name should contain that visible text. - Target size. WCAG 2.2 criterion 2.5.8 Target Size (Minimum) asks for at least 24 by 24 CSS pixels, with exceptions such as enough spacing around a smaller target. Platform guides go further: Apple’s Human Interface Guidelines recommend at least 44 by 44 points, and Google’s Material Design recommends 48 by 48 dp (density-independent pixels).
- Keyboard and focus. The account menu must open with the keyboard, and the focus outline must stay visible on the logout item (WCAG 2.4.7 Focus Visible, level AA).
- Status message. If logout happens without a page change, announce it to screen readers with a live region, in line with WCAG 4.1.3 Status Messages.
Use a real <button> inside a form when logout sends a request with POST, the HTTP method meant for actions that change data. Use a link only when it truly navigates to a logout page. Screen readers announce the two differently, and keyboard users expect each to behave like itself.

Building it: WordPress, WooCommerce and a Bootstrap sidebar
Two setups cover most of the sites a web design studio ships: WordPress (with or without WooCommerce) and custom dashboards built on Bootstrap.
WordPress and WooCommerce
- Avoid typing
/wp-login.php?action=logoutas a custom link in Appearance > Menus. That URL lacks the security token (a nonce) WordPress expects, so visitors land on a screen asking “Do you really want to log out?”, an accidental confirmation step. - Generate the link in your theme or a small snippet with
wp_logout_url( home_url() ), which adds the nonce and sets where people land afterwards. - On WooCommerce stores, the logout endpoint is set in WooCommerce > Settings > Advanced, under Account endpoints (
customer-logoutby default). Use the “Logout” entry the “My account” navigation already provides. A hand-made link without its nonce can bring back the same kind of confirmation step as on WordPress, so test the link while logged in. - To track down a leftover “Logout” link after a plugin was removed, we’d start with Appearance > Menus. Next comes the header builder of your theme, then custom functions in the child theme or another plugin.
Bootstrap dashboard: logout pinned to the bottom of the sidebar
A frequent request on dashboards is a sidebar with navigation at the top and logout at the bottom. Flexbox does it without absolute positioning:
<nav class="d-flex flex-column vh-100 p-3">
<ul class="nav flex-column">
<li class="nav-item"><a class="nav-link" href="/dashboard">Dashboard</a></li>
</ul>
<form class="mt-auto" method="post" action="/logout">
<button type="submit" class="btn btn-link">
<i class="bi bi-box-arrow-right" aria-hidden="true"></i> Log out
</button>
</form>
</nav>
The container is a column with full viewport height, and mt-auto (an automatic top margin) pushes the logout form to the bottom. The icon is hidden from screen readers because the visible text already names the action.
Pitfalls that make logout fail
Users say they can’t log out. In our view, the likeliest cause is a logout item hidden at the bottom of a scrolling menu, or one that only exists on some pages. If the scrollbar fails to render, the item vanishes entirely. The fix is to show logout in the header account menu on every page, in a menu short enough to display every item without scrolling on a small laptop screen.
The back button shows the account after logout. The server ended the session, but the browser kept cached copies of account pages. Fix it by sending Cache-Control: no-store on those pages and Clear-Site-Data on the logout response.
After signing in again, users land back on the logout page. The login form redirects to the last URL visited, which was /logout. Exclude logout and login URLs from the “return to” logic.
A random link logs people out. When logout uses GET, the method a plain link sends, another site or an image tag can trigger it without the user’s consent. Make logout a POST request with an anti-forgery token, or a nonce on WordPress.

How to measure whether your logout button design works
A logout rarely shows up in analytics dashboards, but three signals tell you if the design works:
- Support messages and search queries containing “log out” or “sign out”: a steady trickle means people can’t find it.
- A 5-minute task test with 3 to 5 people: ask them to log out and switch to another account, and watch where they look first.
- Session expiry events followed by a new login within a few minutes: a high count suggests the timeout is too short or the warning is missing.
Review these after each redesign of the header or account menu, since that’s when the logout usually moves.
Logout design checklist
- Label says “Log out” or “Sign out”, matching the sign-in wording.
- Exit icon (arrow out of a box), never the power symbol, always with text.
- Last item of the account menu, reachable from every page.
- One-click logout; confirmation only when unsaved work or a running task is at stake.
- Session ended on the server, cookie deleted, logout sent as POST.
- Logged-out page with a confirmation message and a “Log in again” link.
- Account pages not cached; back button shows nothing private.
- Timeout warning before expiry, with a one-click “Stay signed in”.
- Return to the same page after signing in again, with drafts kept.
- Accessible name, visible focus and a target of at least 24 by 24 CSS pixels.
Next step
Open your own site or app, sign in, and try to log out from three different pages, once with the mouse and once with the keyboard alone. Then leave a form half-filled until the session expires and see what happens to your text. Those two minutes of testing will show you exactly which items of the checklist to fix first.
At The Hang Line we write about the small interface details that decide how a site feels to use. Browse our other web design articles for more patterns you can apply to your next project.
FAQ
Can a logout button be creative?
Yes, within limits. You can style it to match your brand, animate the icon on hover or add a friendly line on the logged-out page. Keep the words “Log out” readable and the position predictable, because creativity that makes the exit hard to find costs more than it brings.
Should the logout button be red?
Usually not. Red suggests a destructive action such as deleting an account, and logging out destroys nothing. A neutral text link or ghost button fits better.
Do mobile apps still need a logout button?
Yes. Mobile apps tend to keep people signed in for long periods, but users still need a way to switch accounts, hand their phone to someone else or sell the device. Put it at the bottom of the profile or settings screen.
Should I ask users why they’re logging out?
No. Logging out isn’t cancelling a subscription, and a survey at that moment only slows people down. If you want feedback, ask somewhere else in the product.
Where can I find free logout icons in SVG (Scalable Vector Graphics) or PNG (Portable Network Graphics)?
Open-source icon sets such as Material Symbols, Bootstrap Icons and Font Awesome’s free set include a logout icon in SVG, which stays sharp at any size. You can export it to PNG if you need a bitmap image. Check each set’s license before using it in a commercial project.