express-session
Advanced tools
Comparing version 1.12.1 to 1.13.0
@@ -0,1 +1,8 @@ | ||
1.13.0 / 2016-01-10 | ||
=================== | ||
* Fix `rolling: true` to not set cookie when no session exists | ||
- Better `saveUninitialized: false` + `rolling: true` behavior | ||
* deps: crc@3.4.0 | ||
1.12.1 / 2015-10-29 | ||
@@ -2,0 +9,0 @@ =================== |
@@ -388,10 +388,5 @@ /*! | ||
// in case of rolling session, always reset the cookie | ||
if (rollingSessions) { | ||
return true; | ||
} | ||
return cookieId != req.sessionID | ||
? saveUninitializedSession || isModified(req.session) | ||
: req.session.cookie.expires != null && isModified(req.session); | ||
: rollingSessions || req.session.cookie.expires != null && isModified(req.session); | ||
} | ||
@@ -398,0 +393,0 @@ |
{ | ||
"name": "express-session", | ||
"version": "1.12.1", | ||
"version": "1.13.0", | ||
"description": "Simple session middleware for Express", | ||
@@ -15,3 +15,3 @@ "author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)", | ||
"cookie-signature": "1.0.6", | ||
"crc": "3.3.0", | ||
"crc": "3.4.0", | ||
"debug": "~2.2.0", | ||
@@ -28,4 +28,4 @@ "depd": "~1.1.0", | ||
"express": "~4.13.3", | ||
"istanbul": "0.4.0", | ||
"mocha": "2.3.3", | ||
"istanbul": "0.4.1", | ||
"mocha": "2.3.4", | ||
"supertest": "1.1.0" | ||
@@ -32,0 +32,0 @@ }, |
@@ -53,3 +53,3 @@ # express-session | ||
The default value is a function which uses the `uid2` library to generate IDs. | ||
The default value is a function which uses the `uid-safe` library to generate IDs. | ||
@@ -112,6 +112,12 @@ **NOTE** be careful to generate unique IDs so your sessions do not conflict. | ||
Force a cookie to be set on every response. This resets the expiration date. | ||
Force a session identifier cookie to be set on every response. The expiration | ||
is reset to the original [`maxAge`](#cookiemaxage), resetting the expiration | ||
countdown. | ||
The default value is `false`. | ||
**Note** When this option is set to `true` but the `saveUnitialized` option is | ||
set to `false`, the cookie will not be set on a response with an uninitialized | ||
session. | ||
##### saveUninitialized | ||
@@ -215,5 +221,7 @@ | ||
```js | ||
// Use the session middleware | ||
app.use(session({ secret: 'keyboard cat', cookie: { maxAge: 60000 }})) | ||
app.use(function(req, res, next) { | ||
// Access the session as req.session | ||
app.get('/', function(req, res, next) { | ||
var sess = req.session | ||
@@ -266,2 +274,14 @@ if (sess.views) { | ||
Save the session back to the store, replacing the contents on the store with the | ||
contents in memory (though a store may do something else--consult the store's | ||
documentation for exact behavior). | ||
This method is automatically called at the end of the HTTP response if the | ||
session data has been altered (though this behavior can be altered with various | ||
options in the middleware constructor). Because of this, typically this method | ||
does not need to be called. | ||
There are some cases where it is useful to call this method, for example, long- | ||
lived requests or in WebSockets. | ||
```js | ||
@@ -397,7 +417,7 @@ req.session.save(function(err) { | ||
[![Github Stars][cassandra-store-image] cassandra-store][cassandra-store-url] An Apache Cassandra-based session store. | ||
[![★][cassandra-store-image] cassandra-store][cassandra-store-url] An Apache Cassandra-based session store. | ||
[cassandra-store-url]: https://www.npmjs.com/package/cassandra-store | ||
[cassandra-store-image]: https://img.shields.io/github/stars/webcc/cassandra-store.svg?label=%E2%98%85 | ||
[![Github Stars][cluster-store-image] cluster-store][cluster-store-url] A wrapper for using in-process / embedded | ||
[![★][cluster-store-image] cluster-store][cluster-store-url] A wrapper for using in-process / embedded | ||
stores - such as SQLite (via knex), leveldb, files, or memory - with node cluster (desirable for Raspberry Pi 2 | ||
@@ -408,31 +428,35 @@ and other multi-core embedded devices). | ||
[![Github Stars][connect-couchbase-image] connect-couchbase][connect-couchbase-url] A [couchbase](http://www.couchbase.com/)-based session store. | ||
[![★][connect-couchbase-image] connect-couchbase][connect-couchbase-url] A [couchbase](http://www.couchbase.com/)-based session store. | ||
[connect-couchbase-url]: https://www.npmjs.com/package/connect-couchbase | ||
[connect-couchbase-image]: https://img.shields.io/github/stars/christophermina/connect-couchbase.svg?label=%E2%98%85 | ||
[![Github Stars][connect-mssql-image] connect-mssql][connect-mssql-url] A SQL Server-based session store. | ||
[![★][connect-mssql-image] connect-mssql][connect-mssql-url] A SQL Server-based session store. | ||
[connect-mssql-url]: https://www.npmjs.com/package/connect-mssql | ||
[connect-mssql-image]: https://img.shields.io/github/stars/patriksimek/connect-mssql.svg?label=%E2%98%85 | ||
[![Github Stars][connect-monetdb-image] connect-monetdb][connect-monetdb-url] A MonetDB-based session store. | ||
[![★][connect-monetdb-image] connect-monetdb][connect-monetdb-url] A MonetDB-based session store. | ||
[connect-monetdb-url]: https://www.npmjs.com/package/connect-monetdb | ||
[connect-monetdb-image]: https://img.shields.io/github/stars/MonetDB/npm-connect-monetdb.svg?label=%E2%98%85 | ||
[![Github Stars][connect-mongo-image] connect-mongo][connect-mongo-url] A MongoDB-based session store. | ||
[![★][connect-mongo-image] connect-mongo][connect-mongo-url] A MongoDB-based session store. | ||
[connect-mongo-url]: https://www.npmjs.com/package/connect-mongo | ||
[connect-mongo-image]: https://img.shields.io/github/stars/kcbanner/connect-mongo.svg?label=%E2%98%85 | ||
[![Github Stars][connect-mongodb-session-image] connect-mongodb-session][connect-mongodb-session-url] Lightweight MongoDB-based session store built and maintained by MongoDB. | ||
[![★][connect-mongodb-session-image] connect-mongodb-session][connect-mongodb-session-url] Lightweight MongoDB-based session store built and maintained by MongoDB. | ||
[connect-mongodb-session-url]: https://www.npmjs.com/package/connect-mongodb-session | ||
[connect-mongodb-session-image]: https://img.shields.io/github/stars/mongodb-js/connect-mongodb-session.svg?label=%E2%98%85 | ||
[![Github Stars][connect-pg-simple-image] connect-pg-simple][connect-pg-simple-url] A PostgreSQL-based session store. | ||
[![★][connect-pg-simple-image] connect-pg-simple][connect-pg-simple-url] A PostgreSQL-based session store. | ||
[connect-pg-simple-url]: https://www.npmjs.com/package/connect-pg-simple | ||
[connect-pg-simple-image]: https://img.shields.io/github/stars/voxpelli/node-connect-pg-simple.svg?label=%E2%98%85 | ||
[![Github Stars][connect-redis-image] connect-redis][connect-redis-url] A Redis-based session store. | ||
[![★][connect-redis-image] connect-redis][connect-redis-url] A Redis-based session store. | ||
[connect-redis-url]: https://www.npmjs.com/package/connect-redis | ||
[connect-redis-image]: https://img.shields.io/github/stars/tj/connect-redis.svg?label=%E2%98%85 | ||
[![Github Stars][connect-session-knex-image] connect-session-knex][connect-session-knex-url] A session store using | ||
[![★][connect-memcached-image] connect-memcached][connect-memcached-url] A memcached-based session store. | ||
[connect-memcached-url]: https://www.npmjs.com/package/connect-memcached | ||
[connect-memcached-image]: https://img.shields.io/github/stars/balor/connect-memcached.svg?label=%E2%98%85 | ||
[![★][connect-session-knex-image] connect-session-knex][connect-session-knex-url] A session store using | ||
[Knex.js](http://knexjs.org/), which is a SQL query builder for PostgreSQL, MySQL, MariaDB, SQLite3, and Oracle. | ||
@@ -442,3 +466,3 @@ [connect-session-knex-url]: https://www.npmjs.com/package/connect-session-knex | ||
[![Github Stars][connect-session-sequelize-image] connect-session-sequelize][connect-session-sequelize-url] A session store using | ||
[![★][connect-session-sequelize-image] connect-session-sequelize][connect-session-sequelize-url] A session store using | ||
[Sequelize.js](http://sequelizejs.com/), which is a Node.js / io.js ORM for PostgreSQL, MySQL, SQLite and MSSQL. | ||
@@ -448,19 +472,31 @@ [connect-session-sequelize-url]: https://www.npmjs.com/package/connect-session-sequelize | ||
[![Github Stars][express-nedb-session-image] express-nedb-session][express-nedb-session-url] A NeDB-based session store. | ||
[![★][connect-sqlite3-image] connect-sqlite3][connect-sqlite3-url] A [SQLite3](https://github.com/mapbox/node-sqlite3) session store modeled after the TJ's `connect-redis` store. | ||
[connect-sqlite3-url]: https://www.npmjs.com/package/connect-sqlite3 | ||
[connect-sqlite3-image]: https://img.shields.io/github/stars/rawberg/connect-sqlite3.svg?label=%E2%98%85 | ||
[![★][express-nedb-session-image] express-nedb-session][express-nedb-session-url] A NeDB-based session store. | ||
[express-nedb-session-url]: https://www.npmjs.com/package/express-nedb-session | ||
[express-nedb-session-image]: https://img.shields.io/github/stars/louischatriot/express-nedb-session.svg?label=%E2%98%85 | ||
[![Github Stars][level-session-store-image] level-session-store][level-session-store-url] A LevelDB-based session store. | ||
[![★][level-session-store-image] level-session-store][level-session-store-url] A LevelDB-based session store. | ||
[level-session-store-url]: https://www.npmjs.com/package/level-session-store | ||
[level-session-store-image]: https://img.shields.io/github/stars/scriptollc/level-session-store.svg?label=%E2%98%85 | ||
[![Github Stars][mssql-session-store-image] mssql-session-store][mssql-session-store-url] A SQL Server-based session store. | ||
[![★][mssql-session-store-image] mssql-session-store][mssql-session-store-url] A SQL Server-based session store. | ||
[mssql-session-store-url]: https://www.npmjs.com/package/mssql-session-store | ||
[mssql-session-store-image]: https://img.shields.io/github/stars/jwathen/mssql-session-store.svg?label=%E2%98%85 | ||
[![Github Stars][session-file-store-image] session-file-store][session-file-store-url] A file system-based session store. | ||
[![★][nedb-session-store-image] nedb-session-store][nedb-session-store-url] An alternate NeDB-based (either in-memory or file-persisted) session store. | ||
[nedb-session-store-url]: https://www.npmjs.com/package/nedb-session-store | ||
[nedb-session-store-image]: https://img.shields.io/github/stars/JamesMGreene/nedb-session-store.svg?label=%E2%98%85 | ||
[![★][sequelstore-connect-image] sequelstore-connect][sequelstore-connect-url] A session store using [Sequelize.js](http://sequelizejs.com/). | ||
[sequelstore-connect-url]: https://www.npmjs.com/package/sequelstore-connect | ||
[sequelstore-connect-image]: https://img.shields.io/github/stars/MattMcFarland/sequelstore-connect.svg?label=%E2%98%85 | ||
[![★][session-file-store-image] session-file-store][session-file-store-url] A file system-based session store. | ||
[session-file-store-url]: https://www.npmjs.com/package/session-file-store | ||
[session-file-store-image]: https://img.shields.io/github/stars/valery-barysok/session-file-store.svg?label=%E2%98%85 | ||
[![Github Stars][session-rethinkdb-image] session-rethinkdb][session-rethinkdb-url] A [RethinkDB](http://rethinkdb.com/)-based session store. | ||
[![★][session-rethinkdb-image] session-rethinkdb][session-rethinkdb-url] A [RethinkDB](http://rethinkdb.com/)-based session store. | ||
[session-rethinkdb-url]: https://www.npmjs.com/package/session-rethinkdb | ||
@@ -467,0 +503,0 @@ [session-rethinkdb-image]: https://img.shields.io/github/stars/llambda/session-rethinkdb.svg?label=%E2%98%85 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55008
553
922