News:

Wondering if this will always be free?  See why free is better.

Main Menu

Writing Logout Link

Started by PS4DEV, March 14, 2012, 11:59:44 AM

Previous topic - Next topic

PS4DEV

How do i write a logout link ?  i need a session var...

something like that:
<a href="', $scripturl,'?action=logout + session var">

thanks a lot.

PS4DEV

Ok, managed it myself,
if someone is interested in it, it´s:
<a href="', $scripturl,'?action=logout;', $context['session_var'],'=', $context['session_id'] ,'">Logout</a>

solved

Suki

Thank you for posting the solution PS4DEV.

Yes, that is the way to write a logout link, Sources/Subs.php doesn't do this directly on the button but later in the code:


// Logging out requires the session id in the url.
if (isset($context['menu_buttons']['logout']))
$context['menu_buttons']['logout']['href'] = sprintf($context['menu_buttons']['logout']['href'], $context['session_var'], $context['session_id']);
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Advertisement: