Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Railsの表面にない部分についてはあまり経験がありません。
私が欲しいのは、有効期限が設定されているセッションCookieを用意してsession、ユーザーがブラウザなどを離れたときに期限切れになるようにすることです。セキュリティ対策として。
session
デフォルトでは、CookieはセッションCookieです。でオプションハッシュを提供することにより、Cookieを完全に制御できますconfig/initializers/session_store.rb。オプションはと同じですRack::Session::Cookie(ドキュメントを参照)。したがって、たとえば、特定の有効期限については、を指定できます:expire_after。
config/initializers/session_store.rb
Rack::Session::Cookie
:expire_after
Deviseとstrategyを使用rememberableしている場合は、ユーザーを取得するために使用できる別のCookieがあります。
rememberable
あなたはそれを設定することができます。これらのリンクを見てください