Skip to Content
Menú
This question has been flagged
2 Respostes
14033 Vistes

Hi,

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


Thanks.

Avatar
Descartar
Best Answer

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
Descartar

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

Best Answer

You can also trigger logout in controllers with the method:

request.session.logout()

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de maig 25
1227
0
de febr. 22
3223
2
de gen. 22
3376
2
de gen. 22
4519
1
d’oct. 15
12562