mm_session 1.5.6 → 1.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/session.js +2 -3
- package/package.json +1 -1
package/lib/session.js
CHANGED
|
@@ -25,7 +25,7 @@ class Session {
|
|
|
25
25
|
// session ID过期时间,单位秒,默认7天
|
|
26
26
|
uuid_expire: $.dict.uuid_expire || 60 * 60 * 24 * 7,
|
|
27
27
|
// session过期时间,单位秒,默认2小时
|
|
28
|
-
max_age: 60 * 60 * 2,
|
|
28
|
+
max_age: $.dict.max_age || 60 * 60 * 2,
|
|
29
29
|
// 过期token处理选项:'reject'(拒绝访问)或'allow'(允许访问缓存)
|
|
30
30
|
expired_handling: 'reject',
|
|
31
31
|
};
|
|
@@ -446,8 +446,7 @@ Session.prototype._verifyExpiration = async function (end_time) {
|
|
|
446
446
|
Session.prototype._checkSessionId = async function (session_id, client_ip, client_ua) {
|
|
447
447
|
try {
|
|
448
448
|
// 解码session_id
|
|
449
|
-
var data = this._helper.
|
|
450
|
-
this.config.encrypt_key, this._helper._getSecret(client_ua));
|
|
449
|
+
var data = this._helper.parseId(this.config.encrypt_key, session_id, client_ua);
|
|
451
450
|
if (!data) return false;
|
|
452
451
|
let { ip, end_time } = data;
|
|
453
452
|
// 验证IP
|