Cookies not correctly updated within a --follow redirect chain
See original GitHub issueHello,
when site creates new session for user, the PHPSESSID is not overrided but both the old and the new one is sent. Please notice Cookie header in last request. I’m using httpie version 0.9.8.
» http --verbose --session=/tmp/yamaha.json --form --follow POST https://www.yamaha-extranet.com/login/index email=foo@bar.baz password=bar submitform=Submit
POST /login/index HTTP/1.1
Cookie: PHPSESSID=mdslhb7u0giujsaf8itq2gm2p0
Host: www.yamaha-extranet.com
User-Agent: HTTPie/0.9.8
email=****&submitform=Submit
HTTP/1.1 302 Found
Location: /
Set-Cookie: PHPSESSID=nb7qnhkfjsdtpe8gtj797koaq7; path=/; domain=www.yamaha-extranet.com; secure
X-Powered-By: PHP/5.5.38
GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cookie: PHPSESSID=mdslhb7u0giujsaf8itq2gm2p0; PHPSESSID=nb7qnhkfjsdtpe8gtj797koaq7
Host: www.yamaha-extranet.com
User-Agent: HTTPie/0.9.8
Session file contains only one PHPSESSID though.
{
"__meta__": {
"about": "HTTPie session file",
"help": "https://httpie.org/docs#sessions",
"httpie": "0.9.8"
},
"auth": {
"password": null,
"type": null,
"username": null
},
"cookies": {
"PHPSESSID": {
"expires": null,
"path": "/",
"secure": true,
"value": "nb7qnhkfjsdtpe8gtj797koaq7"
}
},
"headers": {}
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:17 (8 by maintainers)
Top Results From Across the Web
Cookies not correctly updated within a --follow redirect chain
Hello, when site creates new session for user, the PHPSESSID is not overrided but both the old and the new one is sent....
Read more >Cookies not correctly updated within a --follow redirect chain
Hello,. when site creates new session for user, the PHPSESSID is not overrided but both the old and the new one is sent....
Read more >http - Sending browser cookies during a 302 redirect
Details: We sent HTTP 302 redirect with Set-Cookie header with "SameSite=Strict" policy and Location pointing at a different path of the same domain....
Read more >Cookies set with SameSite=strict are not sent in redirects
Clear all nav data · Visit url redirecting to same domain with set cookie samesite="strict" · Check cookie is not sent in request...
Read more >Redirect chains and SEO: all you need to know!
Delayed crawling: Google usually follows only up to five redirect hops during one crawl. · Lost link equity: keep in mind that not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@asifmallik luckily,
/cookies/set
also redirects. So this is how you can reproduce it:1. prepare a session with a cookie
2. call
/cookies/set
It should also handle and have tests for
--session-readonly
(cookies should be assigned after each request, but the session file shoud not be updated).Glad you liked it! @adamtaylor13