Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
13882 Tampilan

Hi,

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


Thanks.

Avatar
Buang
Jawaban Terbai

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
Buang

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

Jawaban Terbai

You can also trigger logout in controllers with the method:

request.session.logout()

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Mei 25
1094
0
Feb 22
3107
2
Jan 22
3265
2
Jan 22
4382
1
Okt 15
12431