Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
13894 Представления

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
1108
0
февр. 22
3114
2
янв. 22
3279
2
янв. 22
4395
1
окт. 15
12440