Skip to content
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

update readme with information/warning about cookie length #115

Merged
merged 2 commits into from Feb 26, 2016

Conversation

@geuis
Copy link
Contributor

geuis commented Feb 21, 2016

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.

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.

This comment has been minimized.

Copy link
@jaw187

jaw187 Feb 24, 2016

Contributor

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
@jaw187 jaw187 merged commit 7718749 into hapijs:master Feb 26, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@nlf nlf added the documentation label Mar 28, 2017
@nlf nlf added this to the 7.0.0 milestone Mar 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.