设置HttpOnly以获取经典ASP cookie

时间:2016-02-22 19:07:06

标签: cookies asp-classic

我正在努力将HttpOnly添加到我的经典ASP cookie中。我已经尝试了所有我能找到的解决方案,但似乎他们在我的情况下没有工作。 以下是我必须设置cookie的代码:

Sub StoreCookieValue(byVal strParameter, byVal strValue)
    Select Case UCase(strParameter)
    'Case "USERID":         Response.Cookies("SessionTestCom")("UserID") = strValue
    '                       gstrUserID = strValue


    Case "SESSID":          Response.Cookies("SessionTestCom")("SessID") = strValue 
                            gintSessionID = strValue

    Case "ACCESSNUMBER":    Response.Cookies("SessionTestCom")("AccessNumber") = strValue
                            gstrAccessNumber = strValue
    Case "USERIDKEY"   :    Response.Cookies("SessionTestCom")("UserIdKey") = strValue
                            gstrAccessNumber = strValue
    End Select

    Response.Cookies("SessionTestCom").Path = "/"
    Response.Cookies("SessionTestCom").Secure  = True
    Response.AddHeader "Set-Cookie", ""&CStr(Request.ServerVariables("HTTP_COOKIE"))&";path=/;HttpOnly"&""

End Sub

任何想法?

1 个答案:

答案 0 :(得分:0)

好的,这是我应用的解决方案,它有效。

Setting HTTPONLY for Classic Asp Session Cookie

我将重写规则添加到iOS并修复了它。