-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Documentation For Duration Support & Expiry Meta Data Added to Signed / Encrypted Cookies #30407
Merged
kaspth
merged 1 commit into
rails:master
from
assain:document-expiry-metadata-support-cookies
Sep 4, 2017
Merged
Add Documentation For Duration Support & Expiry Meta Data Added to Signed / Encrypted Cookies #30407
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,10 @@ def cookies_digest | |
# cookies[:lat_lon] = JSON.generate([47.68, -122.37]) | ||
# | ||
# # Sets a cookie that expires in 1 hour. | ||
# cookies[:login] = { value: "XJ-122", expires: 1.hour.from_now } | ||
# cookies[:login] = { value: "XJ-122", expires: 1.hour } | ||
# | ||
# # Sets a cookie that expires at a specific time. | ||
# cookies[:login] = { value: "XJ-122", expires: Time.utc(2020, 10, 15, 5) } | ||
# | ||
# # Sets a signed cookie, which prevents users from tampering with its value. | ||
# # The cookie is signed by your app's `secrets.secret_key_base` value. | ||
|
@@ -100,7 +103,7 @@ def cookies_digest | |
# cookies.permanent[:login] = "XJ-122" | ||
# | ||
# # You can also chain these methods: | ||
# cookies.permanent.signed[:login] = "XJ-122" | ||
# cookies.signed.permanent[:login] = "XJ-122" | ||
# | ||
# Examples of reading: | ||
# | ||
|
@@ -118,7 +121,7 @@ def cookies_digest | |
# | ||
# cookies[:name] = { | ||
# value: 'a yummy cookie', | ||
# expires: 1.year.from_now, | ||
# expires: 1.year, | ||
# domain: 'domain.com' | ||
# } | ||
# | ||
|
@@ -144,7 +147,7 @@ def cookies_digest | |
# * <tt>:tld_length</tt> - When using <tt>:domain => :all</tt>, this option can be used to explicitly | ||
# set the TLD length when using a short (<= 3 character) domain that is being interpreted as part of a TLD. | ||
# For example, to share cookies between user1.lvh.me and user2.lvh.me, set <tt>:tld_length</tt> to 1. | ||
# * <tt>:expires</tt> - The time at which this cookie expires, as a \Time object. | ||
# * <tt>:expires</tt> - The time at which this cookie expires, as a \Time or ActiveSupport::Duration object. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this link to the duration class when the doc is generated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
# * <tt>:secure</tt> - Whether this cookie is only transmitted to HTTPS servers. | ||
# Default is +false+. | ||
# * <tt>:httponly</tt> - Whether this cookie is accessible via scripting or | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaspth Is it alright if I make this change? 😄