package.json 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {
  2. "name": "cookie-session",
  3. "description": "cookie session middleware",
  4. "repository": {
  5. "type": "git",
  6. "url": "git://github.com/expressjs/cookie-session"
  7. },
  8. "version": "1.1.0",
  9. "keywords": [
  10. "connect",
  11. "express",
  12. "middleware",
  13. "session"
  14. ],
  15. "dependencies": {
  16. "cookies": "0.5.0",
  17. "debug": "~2.1.0",
  18. "on-headers": "~1.0.0"
  19. },
  20. "devDependencies": {
  21. "connect": "3",
  22. "istanbul": "0.3.2",
  23. "mocha": "~2.0.1",
  24. "supertest": "~0.14.0"
  25. },
  26. "files": [
  27. "HISTORY.md",
  28. "LICENSE",
  29. "README.md",
  30. "index.js"
  31. ],
  32. "license": "MIT",
  33. "scripts": {
  34. "test": "mocha --check-leaks --reporter spec --bail test/",
  35. "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/",
  36. "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/"
  37. },
  38. "readme": "# cookie-session\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n[![Gratipay][gratipay-image]][gratipay-url]\n\n Simple cookie-based session middleware.\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## Install\n\n```bash\n$ npm install cookie-session\n```\n\n## API\n\n View counter example:\n\n```js\nvar express = require('express')\nvar session = require('cookie-session')\n\nvar app = express()\n\napp.set('trust proxy', 1) // trust first proxy\n\napp.use(session({\n keys: ['key1', 'key2']\n}))\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)\n```\n\n### Options\n\n - `name` - The cookie name. Defaults to `express:sess`.\n - `keys` - Keys with which to sign the cookie. See `signed` in cookie options. Multiple keys allows for using rotating credentials.\n - `secret` - A string which will be used as single key if `keys` is not found.\n\n 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#### Cookie Options\n\nThe options can also contain any of the follow (for the full list, see [cookies module documentation](https://www.npmjs.org/package/cookies#readme):\n\n - `maxAge`: a number representing the milliseconds from `Date.now()` for expiry\n - `expires`: a `Date` object indicating the cookie's expiration date (expires at the end of session by default).\n - `path`: a string indicating the path of the cookie (`/` by default).\n - `domain`: a string indicating the domain of the cookie (no default).\n - `secure`: a boolean indicating whether the cookie is only to be sent over HTTPS (`false` by default for HTTP, `true` by default for HTTPS).\n - `secureProxy`: a boolean indicating whether the cookie is only to be sent over HTTPS (use this if you handle SSL not in your node process).\n - `httpOnly`: a boolean indicating whether the cookie is only to be sent over HTTP(S), and not made available to client JavaScript (`true` by default).\n - `signed`: a boolean indicating whether the cookie is to be signed (`false` by default). If this is true, another cookie of the same name with the `.sig` suffix appended will also be sent, with a 27-byte url-safe base64 SHA1 value representing the hash of _cookie-name_=_cookie-value_ against the first [Keygrip](https://github.com/expressjs/keygrip) key. This signature key is used to detect tampering the next time a cookie is received.\n - `overwrite`: a boolean indicating whether to overwrite previously set cookies of the same name (`false` by default). If this is true, all cookies set during the same request with the same name (regardless of path or domain) are filtered out of the Set-Cookie header when setting this cookie.\n\n### Session.isNew\n\n Is `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\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/cookie-session.svg?style=flat\n[npm-url]: https://npmjs.org/package/cookie-session\n[travis-image]: https://img.shields.io/travis/expressjs/cookie-session.svg?style=flat\n[travis-url]: https://travis-ci.org/expressjs/cookie-session\n[coveralls-image]: https://img.shields.io/coveralls/expressjs/cookie-session.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/expressjs/cookie-session?branch=master\n[downloads-image]: https://img.shields.io/npm/dm/cookie-session.svg?style=flat\n[downloads-url]: https://npmjs.org/package/cookie-session\n[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg?style=flat\n[gratipay-url]: https://www.gratipay.com/dougwilson/\n",
  39. "readmeFilename": "README.md",
  40. "bugs": {
  41. "url": "https://github.com/expressjs/cookie-session/issues"
  42. },
  43. "homepage": "https://github.com/expressjs/cookie-session",
  44. "_id": "cookie-session@1.1.0",
  45. "_shasum": "3bd42bfdfac360d80dd8b0842c6aa4a83e2e2470",
  46. "_from": "cookie-session@^1.0.2",
  47. "_resolved": "https://registry.npmjs.org/cookie-session/-/cookie-session-1.1.0.tgz"
  48. }