如何在Express Node JS应用程序中存储多个Cookie会话

时间:2019-02-13 16:50:15

标签: node.js express cookies session-cookies

我在应用程序中使用了快速会话,并且我成功存储了一个会话。 但是我想存储多个会话,我已经很累了,但是它只存储令牌。
这是我的代码

Option Explicit
Public Sub test()
    Dim xmlDoc As Object
    Set xmlDoc = CreateObject("MSXML2.DOMDocument")
    With xmlDoc
        .validateOnParse = True
        .setProperty "SelectionLanguage", "XPath"
        .async = False

        If Not .Load("C:\Users\User\Desktop\Test.xml") Then
            Err.Raise .parseError.ErrorCode, , .parseError.reason
        End If
    End With
    Dim elem As Object, attrib As Object

    For Each elem In xmlDoc.SelectNodes("//Tool[@name='TN901']")
       For Each attrib In elem.Attributes
           Debug.Print attrib.nodeName, attrib.Text
       Next
    Next
End Sub

但是我想使用这样的东西

    var session = require('express-session');
    var sess;
    app.use(
       session({
        secret: [keys.cookieKey],
        saveUninitialized: true,
        resave: true,
        expires: new Date(Date.now() + 30 * 24 * 3600 * 1000)
    }));
   sess = req.session;
   sess.token = req.user.token;

我很累,但它只存储令牌cookie。请帮助存储多个cookie

0 个答案:

没有答案