Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
13582 Widoki

Hi,

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


Thanks.

Awatar
Odrzuć
Najlepsza odpowiedź

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.


Awatar
Odrzuć

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

Najlepsza odpowiedź

You can also trigger logout in controllers with the method:

request.session.logout()

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
maj 25
886
0
lut 22
2921
2
sty 22
3025
2
sty 22
4161
1
paź 15
12193