ming_node 2.5.0 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +5 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * By : Minglie
4
4
  * QQ: 934031452
5
5
  * Date :2021.12.01
6
- * version :2.5.0
6
+ * version :2.6.0
7
7
  */
8
8
  var http = require('http');
9
9
  var https = require('https');
@@ -1512,13 +1512,15 @@ M.server = function () {
1512
1512
  let o = {}
1513
1513
  o[key] = value;
1514
1514
  let r_cookie = Object.assign(o, cfg)
1515
- res.setHeader("Set-Cookie", querystring.stringify(r_cookie, " ;"));
1515
+ let setCookies= querystring.stringify(r_cookie, " ;");
1516
+ setCookies= setCookies.replace(/%2F/g,'/');
1517
+ res.setHeader("Set-Cookie", setCookies);
1516
1518
  }
1517
1519
  if (true) {
1518
1520
  Object.defineProperty(req, 'session', {
1519
1521
  set: function (o) {
1520
1522
  let sessionValue = req.cookies.sessionid || M.randomStr();
1521
- res.cookie("sessionid", sessionValue)
1523
+ res.cookie("sessionid", sessionValue,{Path:"/"})
1522
1524
  M.sessions[sessionValue] = o;
1523
1525
  },
1524
1526
  get: function () {
package/package.json CHANGED
@@ -46,5 +46,5 @@
46
46
  "scripts": {
47
47
  "test": "echo \"Error: no test specified\" && exit 1"
48
48
  },
49
- "version": "2.5.0"
49
+ "version": "2.6.0"
50
50
  }