Logout from ActiveAdmin destroy other sessions

被刻印的时光 ゝ 提交于 2019-12-12 06:23:57

问题


I am using devise with activeadmin and one other model. If I open both interfaces on browser and logout from one it will also destroy other sessions.

Started GET "/admin/logout" for 127.0.0.1 at 2015-11-03 19:45:25 +0500
Processing by ActiveAdmin::Devise::SessionsController#destroy as HTML
Parameters: {"authenticity_token"=>"6rqzYcjQNgm8sOcAy2ItHvqGWTYyUBEK2tE+hJi8Ti0E25qJLR+vdA9W++HHtFaD3CpBtnNAn6xbhS6mr8YLTQ=="}
Teacher Load (30.4ms)  SELECT  `teachers`.* FROM `teachers` WHERE `teachers`.`id` = ?  ORDER BY `teachers`.`id` ASC LIMIT 1  [["id", 1]]
AdminUser Load (0.2ms)  SELECT  `admin_users`.* FROM `admin_users` WHERE `admin_users`.`id` = ?  ORDER BY `admin_users`.`id` ASC LIMIT 1  [["id", 1]]
SQL (0.1ms)  BEGIN
(0.0ms)  COMMIT
SQL (0.0ms)  BEGIN
(0.0ms)  COMMIT

回答1:


By default when Devise::SessionsController#destroy is invoked it will destroy the sessions from all scopes. This is configurable via sign_out_all_scopes. So to disable it, set it to false:

# config/initializers/devise.rb
config.sign_out_all_scopes = false


来源:https://stackoverflow.com/questions/33502026/logout-from-activeadmin-destroy-other-sessions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!