update readme with information/warning about cookie length#115
Merged
jaw187 merged 2 commits intohapijs:masterfrom Feb 26, 2016
Merged
update readme with information/warning about cookie length#115jaw187 merged 2 commits intohapijs:masterfrom
jaw187 merged 2 commits intohapijs:masterfrom
Conversation
Updated README opening. - Added information about cookie lengths and if they are too long, they don't get set. - Adjusted formatting of text in the opening paragraph to be a little easier to read. I got bit by this today when I spent an hour wondering why my session cookies weren't being set. When I last opened my project, bell + hapi-auth-cookie was signing into Twitter with no problem. But today it was mysteriously failing at first. It finally clicked that the cookie length was way too long. The credential data Twitter was returning a few days ago was a smaller size than today (I may made some last minute change and forgot about it), and that's why it was failing. Since it wasn't documented in the README already, I figure its just a nice thing to remind people about in case they run into a similar problem in the future.
README.md
Outdated
| It is important to remember a couple of things: | ||
|
|
||
| 1. Cookies have a practical maximum length. All of the data you store in a cookie is sent to the browser. If your cookie is too long, browsers may not set it. Read more [here](http://webdesign.about.com/od/cookies/f/web-cookies-size-limit.htm) and [here](http://www.ietf.org/rfc/rfc2965.txt). If you need need to store more data, store a small amount of identifying data in the cookie and use that as a key to a server-side cache system. | ||
| 2. Each cookie operates as a bearer token and anyone in possession of the cookie content can use it to impersonate its true owner. |
Contributor
There was a problem hiding this comment.
Make this first in the list.
jaw187
added a commit
that referenced
this pull request
Feb 26, 2016
update readme with information/warning about cookie length
|
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Updated README opening.
I got bit by this today when I spent an hour wondering why my session cookies weren't being set. When I last opened my project, bell + hapi-auth-cookie was signing into Twitter with no problem. But today it was mysteriously failing at first. It finally clicked that the cookie length was way too long. The credential data Twitter was returning a few days ago was a smaller size than today (I may made some last minute change and forgot about it), and that's why it was failing.
Since it wasn't documented in the README already, I figure its just a nice thing to remind people about in case they run into a similar problem in the future.