jmcarp / jmcarp/robobrowser

browser cookies dont get changed

Open
#78 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3.7k
Forks
336
PR merge metrics
No merged PRs in 30d

Description

I have a website that requires change of cookies
(a post request to server and server replies with headers to set cookies )

here is response headers that supposed to be from chrome browser

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
user: 8888
lg: 2673
x-frame-options: SAMEORIGIN
x-download-options: noopen
Set-Cookie: BrandingUserLocationGroupID=ic4DUh/NXVp8VOKAtyDgbA==; expires=Fri, 01-Sep-2017 17:01:16 GMT; path=/; secure; HttpOnly
Set-Cookie: .AUTH=A69C1A5EE8A5F3626385F35DA1B104EE7DFF5E5AF549DDB02EE8ED53931A0585C0FBB8299E3FC7B428A982B9826EF68390E659F4A74DCE00E195601F400D6E69F53907DADED4194F32DD08A72BA212DCCD0D23AB7C5BD56171E6C55EF1BE90849E9C81B2DAE23B05CA6E361326F44604; expires=Thu, 03-Aug-2017 17:01:17 GMT; path=/; secure; HttpOnly
Server: Unknown
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Strict-Transport-Security: max-age=31536000;includeSubDomains
Date: Wed, 02 Aug 2017 17:01:17 GMT
Content-Length: 335

here is my post request

browser.session.headers['X-Requested-With']='XMLHttpRequest'
browser.open('https://example.com/test/Users/set-role?id='+role_id+'&__RequestVerificationToken='+token,method='POST')
print browser.response.content

this gives me error response as following

{"RedirectUrl":null,"IsSuccess":false,"Message":"Save Failed","CustomMessage":null,"Errors":[{"Key":"","Value":["An error has occurred. This error has automatically been saved for further analysis. Please contact technical support."]}],"Messages":{},"HasView":false,"ViewHtml":null,"ViewUrl":null,"IsValidationException":false,"IsValidationWarning":false,"ReloadPage":false,"IsSessionExpired":false,"Script":null,"NextWizardUrl":null,"PreviousWizardUrl":null,"ShowDialog":false}

anyone knows how to fix it?

thanks

Contributor guide

Open the contributing guide

Research direction

No repository files or tests are named. Start by tracing how browser.session.headers and browser.open handle the POST response and its Set-Cookie headers, then reproduce the request with the supplied example. Done means the response cookies are updated as expected and the subsequent operation no longer returns the reported save failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.