Skip to content

Commit

Permalink
docs: fix session's maxage (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse authored and atian25 committed Mar 20, 2017
1 parent ee77e5c commit 242a4a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/zh-cn/core/cookie-and-session.md
Expand Up @@ -187,8 +187,8 @@ exports.login = function* (ctx) {

// 设置 Session
this.session.user = user;
// 如果用户勾选了 `记住我`,设置一分钟的过期时间
if (rememberMe) this.session.maxAge = ms('1m');
// 如果用户勾选了 `记住我`,设置 30 天的过期时间
if (rememberMe) this.session.maxAge = ms('30d');
};
```

Expand All @@ -215,4 +215,4 @@ exports.middleware = [ 'saveSession' ];
```

[egg-redis]: https://github.com/eggjs/egg-redis
[egg-session-redis]: https://github.com/eggjs/egg-session-redis
[egg-session-redis]: https://github.com/eggjs/egg-session-redis

0 comments on commit 242a4a1

Please sign in to comment.