Skip to content

Commit 7e32454

Browse files
authored
Merge pull request #1015 from ExpressionEngine/7.dev
Pushing logout doc updates live!
2 parents c83d6d7 + 3b25419 commit 7e32454

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

docs/member/logout.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,39 @@
1111

1212
[TOC]
1313

14+
STYLE NOTE: Someone "logs out" (verb, two words) using a "logout link" or "logout form" (adjective, one word).
15+
1416

1517
## Logout Link
1618

17-
This link allows users to log-out of the system. To create the link, use this variable:
19+
The logout link allows logged-in users to log out of ExpressionEngine. It will return the newly logged out visitor to the site's home page. Be aware that "logout" is a reserved word for path, and it does not create a link to `/logout`; it creates an ACT URL that includes a CSRF token. So,
1820

1921
{path='logout'}
2022

21-
Place the variable inside of a link tag:
23+
resolves to something like
24+
25+
https://example.com/?ACT=10&csrf_token=3f9045ab558a35b7caf6a8130439758d02b343df
26+
27+
Usually, you place the path variable inside of a link tag.
2228

2329
<a href="{path='logout'}">Log Out</a>
2430

31+
NOTE: The logout path link will generate with a fresh CSRF token every time it is called, even for visitors who are currently logged out. For maximum site efficiency, you should avoid creating logout links for visitors who are not logged in.
32+
33+
{if logged_in}<a href="{path='logout'}">Log Out</a>{/if}
34+
35+
NOTE: Logging out of the front end of the site deletes the session cookie, so it will also potentially log someone out of the admin panel if your site uses cookies to be logged in to the control panel.
2536

2637
## Logout Form Overview
2738

28-
Output a log out form.
39+
Output a logout form.
2940

30-
{exp:member:logout_form return="mymb/login"}
41+
{exp:member:logout_form return="mymb/goodbye"}
3142
<input type="submit" value="Logout">
3243
{/exp:member:logout_form}
3344

45+
No form fields are needed other than the submit button, and even that could be handled via `form.submit()`. A logout link is almost always sufficient unless you want to specify a specific return URL.
46+
3447
## Parameters
3548

3649
{{embed:_tips/form-attributes.md}}
@@ -39,31 +52,31 @@ Output a log out form.
3952

4053
action="https://example.com/"
4154

42-
Allows you to specify the action attribute of the &lt;form&gt; tag. Handy if you need to ensure that authentication points to SSL portions of your site from non-SSL portions. Often used in conjunction with the return= parameter and the [{current_url} global variable](templates/globals/single-variables.md#current_url) so your visitors will go back to the page and domain they logged in from.
55+
Allows you to specify the action attribute of the &lt;form&gt; tag. Handy if you need to ensure that authentication points to SSL portions of your site from non-SSL portions. Often used in conjunction with the return= parameter and the [{current_url} global variable](templates/globals/single-variables.md#current_url) so your visitors will go back to the page and domain they logged out from.
4356

4457
### `form_class=`
4558

46-
form_class="login"
59+
form_class="logout"
4760

4861
This parameter allows you to specify the class attribute for the &lt;form&gt; tag.
4962

5063
### `form_id=`
5164

52-
form_id="login"
65+
form_id="logout"
5366

5467
This parameter allows you to specify the id attribute for the &lt;form&gt; tag.
5568

5669
### `form_name=`
5770

58-
form_name="login"
71+
form_name="logout"
5972

6073
This parameter allows you to specify a name attribute for the &lt;form&gt; tag.
6174

6275
### `return=`
6376

6477
return="site/index"
6578

66-
This parameter allows you to define where the user will be returned after successfully logging in. The parameter can be defined in two ways:
79+
This parameter allows you to define where the user will be returned after successfully logging out. The parameter can be defined in two ways:
6780

6881
1. Use the standard Template_Group/Template syntax to specify where to return the user. For instance, if you want the user to be returned to the "local" Template in the "news" Template Group, you would use: return="news/local"
6982
2. Use a full URL. For example: return="<https://example.com/return.html>"

0 commit comments

Comments
 (0)