Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
13902 Visninger

Hi,

I want to have a button to trigger a session logout? Is this possible?


Thanks.

Avatar
Kassér
Bedste svar

you can trigger logout by going to the following web link (either using ordinary link or button or whatever you like, you can even type it in address bar when you're logged in and follow the link):

/web/session/logout

here you can use redirect argument in order to specify where user should be redirected after logout:

/web/session/logout?redirect=/web

here is ordinary html link example:

<a href="/web/session/logout?redirect=/web">Logout</a>

you can use similar approach in button as well... there is multiple possibilities to implement this, adapt it per your requirements.


Avatar
Kassér

Yes. It working fine. Great ......,

Bedste svar

You can also trigger logout in controllers with the method:

request.session.logout()

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
maj 25
1118
0
feb. 22
3125
2
jan. 22
3293
2
jan. 22
4402
1
okt. 15
12445