Skip to content

Commit

Permalink
session docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joelanman committed Jun 14, 2016
1 parent dab87b6 commit e9d5a39
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ Installation guide for developers (technical):
- [Updating the kit to the latest version](updating-the-kit.md)
- [Tips and tricks](tips-and-tricks.md)
- [Creating routes (server-side programming)](creating-routes.md)
- [Storing data in session](session.md)
23 changes: 23 additions & 0 deletions docs/session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Storing data in session

**Advanced topic**

If you need to store data for each user, the best way to do it is using session data.

This means that if more than one person is using your prototype, their data will not get mixed up.

The easiest way to clear session data is to use 'Incognito mode' for each user, and close that window when you're done.

## How to use

In a route function, refer to `req.session`.

For example you might have `req.session.over18` or `req.session.firstName`.

You can see a full example here:

[https://github.com/expressjs/session#example](https://github.com/expressjs/session#example)

You can read more about Express Session here:

[https://github.com/expressjs/session](https://github.com/expressjs/session)

0 comments on commit e9d5a39

Please sign in to comment.