Login page
Included User's Account component in login.htm page, data-request="onSignin"
works fine
Logout button
Included Session's component in the navigation partial, data-request="onLogout"
, hit error
Questions: Can I include [session] in global partial to make sure "Logout" Ajax handler can trigger on every pages?
OR do I need to include [session] in each of every my created pages ( this seems really hardcoded ) ? May I know what's the best practice of doing/including the component
[session]
security = "all"
==
<header>
<nav>
<ul>
<li><a href="{{ 'login'|page }}">Login</a></li>
<li><a data-request="onLogout" data-request-data="redirect: '/good-bye'">Sign out</a></li>
</ul>
</nav>
</header>
You can use Session component globally if you will add a session in your default layout file e.g.
default.htm
So Open you default layout in Backend CMS menu and assign session component there and
onLogout
error will be solved for sure.If any doubt please comment.