Skip to content

Instantly share code, notes, and snippets.

@tony1223
Created August 14, 2012 09:52
Show Gist options
  • Select an option

  • Save tony1223/3347911 to your computer and use it in GitHub Desktop.

Select an option

Save tony1223/3347911 to your computer and use it in GitHub Desktop.
var express = require('express');
var app = express();
app.get('/', function(req, res) {
res.cookie('test', '123456');
res.cookie('test', '0');
res.redirect('/a');
});
app.get('/a', function(req, res) {
res.send('hello cookie test:'+ req.headers.cookie); //get "0"
});
app.listen(3000);
console.log('listen on port 3000');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment