User Documentation

User:Logout template tag

ExpressionEngine comes with an easy way for members to log out. It can simply be done with the following code:

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

However, it does not let you control the return path. The User:Logout tag allows you to customize the return URL for the logout link.

{exp:user:logout} content {/exp:user:logout}

Parameters

There is just one parameter, and it's required:

return=

return="user/success"

This parameter controls the return path to be appended into the url variable. Specify a template path and/or fake segments for the path.

Variables

There is just one variable, and it's required:

url=

{url}

The variable will parse as the necessary path for EE's logging out process, but will include the return path as specified in the return parameter.

Examples

The simple example below shows you how to create a Logout link with a customized return path:

{exp:user:logout
    return="user/success"
}
    <a href="{url}">Log Out</a>
{/exp:user:logout}

Support

Having problems setting up and/or using User? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.