Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
13903 มุมมอง

Hi,

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


Thanks.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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.


อวตาร
ละทิ้ง

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

คำตอบที่ดีที่สุด

You can also trigger logout in controllers with the method:

request.session.logout()

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 25
1118
0
ก.พ. 22
3128
2
ม.ค. 22
3294
2
ม.ค. 22
4403
1
ต.ค. 15
12445