【问题标题】:Cookie session store's behavior after server restart in Rails 4Rails 4 中服务器重启后 Cookie 会话存储的行为
【发布时间】:2017-09-03 04:17:01
【问题描述】:

我有一个带有 cookie 会话存储的 rails 4 应用程序。重新启动应用程序后,似乎重新创建了用户会话,并且浏览器收到了新的会话 ID,但用户不需要登录,因为新会话保留了最后的信息;但是我想启动会话以设置正确的语言环境 - 是否有任何事件可以用于此目的? 我已经验证它不是从 cookie 恢复 current_user 的设计,所以我认为它是某种会话重启。

Gems included by the bundle:
  * actionmailer (4.1.15)
  * actionpack (4.1.15)
  * actionview (4.1.15)
  * activemodel (4.1.15)
  * activerecord (4.1.15)
  * activerecord-sqlserver-adapter (4.1.6)
  * activesupport (4.1.15)
  * ar-octopus (0.8.6)
  * arel (5.0.1.20140414130214)
  * autoprefixer-rails (6.3.6.2)
  * bcrypt (3.1.11)
  * bootstrap-sass (3.3.6)
  * bootstrap_form (2.6.0)
  * builder (3.2.3)
  * bundler (1.13.6)
  * byebug (9.0.6)
  * cocoon (1.2.9)
  * coffee-rails (4.1.1)
  * coffee-script (2.4.1)
  * coffee-script-source (1.10.0)
  * concurrent-ruby (1.0.2)
  * daemons (1.2.3)
  * devise (3.5.3)
  * devise_ldap_authenticatable (0.8.5)
  * erubis (2.7.0)
  * eventmachine (1.2.0.1)
  * exception_notification (4.1.4)
  * execjs (2.7.0)
  * faraday (0.9.2)
  * flipper (0.7.5)
  * flipper-ui (0.7.5)
  * hashie (3.4.4)
  * i18n (0.8.1)
  * json (1.8.6)
  * jwt (1.5.4)
  * mail (2.6.4)
  * mime-types (3.1)
  * mime-types-data (3.2016.0521)
  * mini_portile2 (2.1.0)
  * minitest (5.10.1)
  * multi_json (1.12.1)
  * multi_logger (0.1.0)
  * multi_xml (0.5.5)
  * multipart-post (2.0.0)
  * net-ldap (0.11)
  * oauth2 (1.0.0)
  * omniauth (1.3.1)
  * omniauth-google-oauth2 (0.4.1 1cd603b)
  * omniauth-oauth2 (1.4.0)
  * orm_adapter (0.5.0)
  * protected_attributes (1.1.3)
  * rack (1.5.5)
  * rack-protection (1.5.3)
  * rack-test (0.6.3)
  * rails (4.1.15)
  * railties (4.1.15)
  * rake (11.2.2)
  * responders (1.1.2)
  * sass (3.4.22)
  * sass-rails (5.0.4)
  * sprockets (3.6.1)
  * sprockets-rails (2.3.3)
  * thin (1.7.0)
  * thor (0.19.1)
  * thread_safe (0.3.6)
  * tilt (2.0.5)
  * tiny_tds (1.0.5)
  * tzinfo (1.2.2)
  * tzinfo-data (1.2016.5)
  * uglifier (3.0.0)
  * warden (1.2.6)

【问题讨论】:

    标签: ruby-on-rails session cookies


    【解决方案1】:

    现在我正在更改 secret_key_base 以在重启期间使所有会话无效,但如果没有它知道如何处理这种情况会很棒

    【讨论】:

      猜你喜欢
      • 2015-07-16
      • 2021-12-07
      • 2012-09-12
      • 2011-04-26
      • 2014-06-09
      • 2015-02-26
      • 2011-07-14
      • 2015-12-19
      • 1970-01-01
      相关资源
      最近更新 更多