Rails Cookies in Mobile

瀏覽次數:34 次
跳到第一則未讀訊息

Allen

未讀,
2017年7月31日 晚上9:07:532017/7/31
收件者:Ruby on Rails: Talk
I'm currently using Redmine and I have a client website using Ruby on Rails with Devise and both seem to suffer the same problem:

On iOS, both safari and Chrome, the cookie don't seem to be kept after closing the browser window, but on desktop, I haven't had to login for over half a year already.

Is there a special setting I need to set in Rails to remember the cookie? For my devise, I've already have rememberable set on my devise model.

Is there something special I need to do to make this work better on mobile?

Phil Edelbrock

未讀,
2017年7月31日 晚上9:50:542017/7/31
收件者:rubyonra...@googlegroups.com
Nothing special, just make sure you aren't using session cookies. Those go away when the browser is closed. What's the expiration of the session cookie? (hint, look in config/initializers/session_store.rb)

Mine looks like this:

Codebase::Application.config.session_store :active_record_store, :expire_after => 1.years


Phil

回覆所有人
回覆作者
轉寄
0 則新訊息