Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. var connect = require("connect");
  2. var Cookies = require("cookies");
  3. connect()
  4. .use(Cookies.express(["key"]))
  5. .use(function(req,res){
  6. console.log(req.cookies.get("foo"));
  7. console.log(req.cookies.get("baz"));
  8. res.end();
  9. })
  10. .listen(8080)
  11.  
  12. bar, baz=tax
  13. undefined
  14.  
  15. curl http://localhost:8080/ -H "Cookie: foo=bar, baz=tax"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement