2015-11-03 106 views
0

我正在使用設計與activeadmin和另一個模型。 如果我在瀏覽器上打開兩個接口並從一個接口註銷,它也會銷燬其他會話。從ActiveAdmin註銷破壞其他會話

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 
+0

其他會話是什麼意思? – nayiaw

+1

@nayiaw:他意味着當他破壞教師會話時,它也會破壞AdminUser會話。 – Jess

+0

是@你說得對 –

回答

1

通過時Devise::SessionsController#destroy調用它會破壞所有範圍的會話默認。這可以通過sign_out_all_scopes進行配置。所以要禁用它,請將其設置爲false:

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