我正在努力将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
任何想法?
答案 0 :(得分:0)