تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
13845 أدوات العرض

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()

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مايو 25
1062
0
فبراير 22
3084
2
يناير 22
3235
2
يناير 22
4337
1
أكتوبر 15
12411