tasty-cookie
A different way of authenticating
Quickstart
Download mongodb.
Run mongod --dbpath <path to database>
Make a new project, and run the example below.
If you actually end up using this module for development purposes, then use HTTPS!
Database Structure
database-----collections-----documents
"yourdb"---.
|---"users"---.
| |---"username"
| |---"password"
| |---"cookie"
|
`---"sessions"---.
|---"stamp"
|---"cookie"
Example
const key = "mylittleponymylittlepony";const dbpath = "mongodb://127.0.0.1:27017/mydb";const refresh = 5000; // 5 secondsconst cookielifespan = 60000; // 1 minute const express = ;const TastyCookie require'tasty-cookie';const bodyParser require'body-parser';const authentication = express;const login = express;const app = ; app;app; TastyCookie; login; authentication; app; app; app; app; process;