Developer forum

Forum » Templates » Extranet logout

Extranet logout

Per Ljung
Reply
Hi!

How can you make a logout link/button that after a click logs out the user? Is it possible with a global template tag or do you have to use a module?

Best regards,
Per

Replies

 
Rune Skovbo
Reply
Hi Per

This should do the trick:

<a href="/Admin/Public/extranetlogoff.aspx?ID=<!--@DwPageID-->">Log out</a>

Or like this in your "tools" menu:
                <!--@If Defined(Global:Extranet.UserName)-->
                    <li>
                        <a href="/Admin/Public/extranetlogoff.aspx?ID=<!--@DwPageID-->">Log out</a>
                    </li>
                <!--@EndIf(Global:Extranet.UserName)-->


/Rune

 
Chris Stead
Reply

Is there some way to run code when a user logs out (e.g. an event I could subscribe to)?

I need to clear out some session variables on log out and I'm not sure how to do this.

Regards,

Chris

 
Lars Larsen
Reply

You can run your own code if you use the API. Use this notification: Dynamicweb.Notifications.Standard.User.OnBeforeExtranetLogOff

Read more about the API and notifications here

Regards,
Lars

   
Chris Stead
Reply

Thanks for the info, and for the swift replies :-)

 

You must be logged in to post in the forum