0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

cookieに有効期限をつける

Posted at

sessionとは何か?

有効期限をつけてみる

3.5.15 ActionDispatch::Session::CookieStore
セッションをcookieに保存する役割を担います。config.session_storeの値を変更すると別のミドルウェアを使えます。

Because CookieStore extends Rack::Session::Abstract::Persisted, many of the options described there can be used to customize the session cookie that is generated. For example:

Rails.application.config.session_store :cookie_store, expire_after: 14.days

would set the session cookie to expire automatically 14 days after creation. Other useful options include :key, :secure, :httponly, and :same_site.

https://api.rubyonrails.org/classes/ActionDispatch/Session/CookieStore.html#:~:text=Because%20CookieStore%20extends,%3Asame_site.

感想

色々不十分なところはあるけどこれから頑張ろう

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?