UNPKG

fruitstand

Version:
41 lines (40 loc) 3.15 kB
{ "name": "cookie-session", "description": "cookie session middleware", "repository": { "type": "git", "url": "git://github.com/expressjs/cookie-session" }, "version": "1.0.1", "keywords": [ "connect", "express", "middleware", "session" ], "files": [ "index.js" ], "dependencies": { "cookies": "~0.4.0", "debug": "*" }, "devDependencies": { "connect": "*", "mocha": "*", "should": "*", "supertest": "*" }, "license": "MIT", "scripts": { "test": "make test" }, "readme": "# cookie-session\n\n Simple cookie-based session middleware.\n\n## Example\n\n View counter example:\n\n```js\nvar session = require('cookie-session');\nvar connect = require('connect');\nvar app = connect();\n\napp.use(session({\n keys: ['a', 'b']\n}));\napp.use(session());\n\napp.use(function (req, res, next){\n var n = req.session.views || 0;\n req.session.views = ++n;\n res.end(n + ' views');\n})\n\napp.listen(3000);\nconsole.log('listening on port 3000');\n```\n\n## Semantics\n\n This module provides \"guest\" sessions, meaning any visitor will have a session,\n authenticated or not. If a session is _new_ a Set-Cookie will be produced regardless\n of populating the session.\n\n## API\n\n### Options\n\n The cookie name is controlled by the `key` option, which defaults\n to \"express:sess\". All other options are passed to `cookies.get()` and\n `cookies.set()` allowing you to control security, domain, path,\n and signing among other settings.\n\n Read more here: https://github.com/jed/cookies\n\n### Session#isNew\n\n Returns __true__ if the session is new.\n\n### Destroying a session\n\n To destroy a session simply set it to `null`:\n\n```js\nreq.session = null;\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Jonathan Ong me@jongleberry.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", "readmeFilename": "Readme.md", "bugs": { "url": "https://github.com/expressjs/cookie-session/issues" }, "homepage": "https://github.com/expressjs/cookie-session", "_id": "cookie-session@1.0.1", "_from": "cookie-session@" }