Skip to content

Commit

Permalink
Merge fdcfba8 into 615e26b
Browse files Browse the repository at this point in the history
  • Loading branch information
piggyman007 committed Oct 15, 2016
2 parents 615e26b + fdcfba8 commit 4c35ff3
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion Readme.md
Expand Up @@ -44,7 +44,16 @@ var koa = require('koa');
var app = koa();

app.keys = ['some secret hurr'];
app.use(session(app));

var CONFIG = {
key: xxx /** (string) cookie key (default is koa:sess) */,
maxAge: xxx /** (number) maxAge in ms (default is 1 days) */,
overwrite: xxx /** (boolean) can overwrite or not (default true) */,
httpOnly: xxx /** (boolean) httpOnly or not (default true) */,
signed: xxx /** (boolean) signed or not (default true) */
};
app.use(session(CONFIG, app));
// or if you prefer all default config, just use => app.use(session(app));

app.use(function *(){
// ignore favicon
Expand Down Expand Up @@ -98,6 +107,15 @@ app.use(convert(session(app)));
### Session#isNew

Returns __true__ if the session is new.

```js
if (this.session.isNew) {
// user has not logged in
}
else {
// user has already logged in
}
```

### Session#maxAge

Expand Down

0 comments on commit 4c35ff3

Please sign in to comment.