python请求cookie过期日期窗体

2024-10-02 22:27:25 发布

您现在位置:Python中文网/ 问答频道 /正文

正在使用python模块请求发送用于登录的网页的接收cookie。我检索了cookie,但当我把它发回时,过期日期格式似乎不正确…有什么提示吗?在

import requests
urlDelete = "https://10.10.7.5/nf/alerts"

urlLogin = "https://10.10.7.5/LOGIN"
params = {'credential_0': 'xxx', 'credential_1': 'xyxy',
          'destination': '//', 'login': 'Log In'}
r = requests.post(urlLogin, data=params, verify=False)
r2 = requests.post(urlDelete, verify=False, cookies=r.cookies)
print(r2)
print(r2.headers)

我的Cookie值:

^{pr2}$

我的标题回应:

{'Cache-control': 'no-cache,max-age=30,must-revalidate',
 'Connection': 'Keep-Alive',
 'Content-Length': '3780',
 'Content-Type': 'text/html; charset=utf-8',
 'Date': 'Sun, 08 Feb 2015 01:13:23 GMT',
 'Keep-Alive': 'timeout=15, max=100',
 'Pragma': 'no-cache',
 'Server': 'Apache',
 'Set-Cookie': 'Mercury::Handler::AuthCookieHandler_AMPAuth=; expires=Mon, 21-May-1971 00:00:00 GMT; path=/; secure;HttpOnly, Mercury::Handler::AuthCookieHandler_AMPAuth=; expires=Mon, 21-May-1971 00:00:00 GMT; path=/; secure;HttpOnly',
 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains',
 'X-CONTENT-TYPE-OPTIONS': 'nosniff',
 'X-Frame-Options': 'SAMEORIGIN'}

Tags: httpsfalsecookieparamspostrequestsmaxcookies