Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
13890 Visualizzazioni

Hi,

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


Thanks.

Avatar
Abbandona
Risposta migliore

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
Abbandona

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

Risposta migliore

You can also trigger logout in controllers with the method:

request.session.logout()

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
mag 25
1107
0
feb 22
3111
2
gen 22
3268
2
gen 22
4392
1
ott 15
12436