Skip to content

Instantly share code, notes, and snippets.

@bjdixon bjdixon/app.js forked from tj/app.js
Created Aug 30, 2014

What would you like to do?
cookie based sessions using express
var express = require('express')
, cookieSessions = require('./cookie-sessions');
var app = express();
app.use(express.cookieParser('manny is cool'));
app.get('/', function(req, res){
req.session.count = req.session.count || 0;
var n = req.session.count++;
res.send('viewed ' + n + ' times\n');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.