From 242a4a1fbecfc4efa37cca58d1861040dd5838bd Mon Sep 17 00:00:00 2001 From: Yiyu He Date: Mon, 20 Mar 2017 10:58:27 +0800 Subject: [PATCH] docs: fix session's maxage (#598) --- docs/source/zh-cn/core/cookie-and-session.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/zh-cn/core/cookie-and-session.md b/docs/source/zh-cn/core/cookie-and-session.md index 84c5cd243d..abaaec7d1c 100644 --- a/docs/source/zh-cn/core/cookie-and-session.md +++ b/docs/source/zh-cn/core/cookie-and-session.md @@ -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'); }; ``` @@ -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 \ No newline at end of file +[egg-session-redis]: https://github.com/eggjs/egg-session-redis