Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE crashes when retrieving http-only session cookies on IE Driver 3.14 #6261

Closed
savsav opened this issue Aug 8, 2018 · 3 comments
Closed

Comments

@savsav
Copy link

savsav commented Aug 8, 2018

Meta -

OS: Windows 7
Selenium Version: IEDriver v3.14 (32-bit)
Browser: Internet Explorer v.11.0.9600.13035 (32-bit)

Expected Behavior -

Cookies are returned by the API.

Actual Behavior -

The GET request to '/session/[session-id]/cookie' is stuck on executing. WebdriverIO was used as test framework but this works on other browsers and a simple curl request reproduces the issue as well (curl -X GET http://127.0.0.1:5555/session/[session-id]/cookie).
Reproduces on sites with http-only & session cookies (e.g. https://www.next.co.uk/ - see the example below).

Show IE Driver Log

T 2018-08-08 16:38:55:852 c:\projects\webdriver\cpp\webdriver-server\server.cc(242) Process request with: URI: /session/

02df7de6-5112-4eb7-8518-47bea7b97262/cookie HTTP verb: GET body: {}

T 2018-08-08 16:38:55:852 c:\projects\webdriver\cpp\webdriver-server\server.cc(331) Entering Server::DispatchCommand

T 2018-08-08 16:38:55:852 c:\projects\webdriver\cpp\webdriver-server\server.cc(661) Entering Server::LookupCommand

D 2018-08-08 16:38:55:852 c:\projects\webdriver\cpp\webdriver-server\server.cc(340) Command: GET /session/02df7de6-5112-4eb7-8518-47bea7b97262/cookie {}

T 2018-08-08 16:38:55:852 c:\projects\webdriver\cpp\webdriver-server\server.cc(456) Entering Server::LookupSession

T 2018-08-08 16:38:55:852 c:\projects\webdriver\cpp\iedriver\iesession.cpp(191) Entering IESession::ExecuteCommand

T 2018-08-08 16:38:55:852 c:\projects\webdriver\cpp\iedriver\iecommandexecutor.cpp(131) Entering IECommandExecutor::OnSetCommand

T 2018-08-08 16:38:55:852 c:\projects\webdriver\cpp\webdriver-server\command.cc(31) Entering Command::Deserialize

D 2018-08-08 16:38:55:852 c:\projects\webdriver\cpp\webdriver-server\command.cc(36) Raw JSON command: { "name" : "getAllCookies", "locator" : { "sessionid" : "02df7de6-5112-4eb7-8518-47bea7b97262" }, "parameters" : {} }

T 2018-08-08 16:38:55:853 c:\projects\webdriver\cpp\iedriver\iecommandexecutor.cpp(142) Entering IECommandExecutor::OnExecCommand

T 2018-08-08 16:38:55:853 c:\projects\webdriver\cpp\iedriver\iesession.cpp(212) Beginning wait for response length to be not zero

T 2018-08-08 16:38:55:853 c:\projects\webdriver\cpp\iedriver\iecommandexecutor.cpp(666) Entering IECommandExecutor::DispatchCommand

T 2018-08-08 16:38:55:853 c:\projects\webdriver\cpp\iedriver\iecommandexecutor.cpp(890) Entering IECommandExecutor::GetCurrentBrowser

T 2018-08-08 16:38:55:853 c:\projects\webdriver\cpp\iedriver\iecommandexecutor.cpp(896) Entering IECommandExecutor::GetManagedBrowser

T 2018-08-08 16:38:55:853 c:\projects\webdriver\cpp\iedriver\iecommandexecutor.cpp(829) Entering IECommandExecutor::IsAlertActive

T 2018-08-08 16:38:55:853 c:\projects\webdriver\cpp\iedriver\browser.cpp(714) Entering Browser::GetActiveDialogWindowHandle

T 2018-08-08 16:38:55:853 c:\projects\webdriver\cpp\iedriver\browser.cpp(218) Entering Browser::GetContentWindowHandle

D 2018-08-08 16:38:55:853 c:\projects\webdriver\cpp\iedriver\iecommandexecutor.cpp(843) No alert handle is found

T 2018-08-08 16:38:55:854 c:\projects\webdriver\cpp\iedriver\iecommandexecutor.cpp(890) Entering IECommandExecutor::GetCurrentBrowser

T 2018-08-08 16:38:55:854 c:\projects\webdriver\cpp\iedriver\iecommandexecutor.cpp(896) Entering IECommandExecutor::GetManagedBrowser

T 2018-08-08 16:38:55:854 c:\projects\webdriver\cpp\iedriver\documenthost.cpp(74) Entering DocumentHost::GetCurrentUrl

T 2018-08-08 16:38:55:854 c:\projects\webdriver\cpp\iedriver\browser.cpp(138) Entering Browser::GetDocument

I 2018-08-08 16:38:55:854 c:\projects\webdriver\cpp\iedriver\browser.cpp(142) No child frame focus. Focus is on top-level frame

T 2018-08-08 16:38:55:875 c:\projects\webdriver\cpp\iedriver\browser.cpp(627) Entering Browser::GetDocumentFromWindow

T 2018-08-08 16:38:55:882 c:\projects\webdriver\cpp\iedriver\cookiemanager.cpp(95) Entering CookieManager::GetCookies

T 2018-08-08 16:38:55:882 c:\projects\webdriver\cpp\iedriver\hookprocessor.cpp(105) Entering HookProcessor::Initialize

T 2018-08-08 16:38:55:882 c:\projects\webdriver\cpp\iedriver\hookprocessor.cpp(201) Entering HookProcessor::CreateReturnPipe

D 2018-08-08 16:38:55:882 c:\projects\webdriver\cpp\iedriver\hookprocessor.cpp(236) Created named pipe \\.\pipe\IEDriverPipe6488

T 2018-08-08 16:38:55:882 c:\projects\webdriver\cpp\iedriver\hookprocessor.cpp(164) Entering HookProcessor::InstallWindowsHook

T 2018-08-08 16:38:55:883 c:\projects\webdriver\cpp\iedriver\cookiemanager.cpp(409) Entering CookieManager::SendGetCookieMessage

T 2018-08-08 16:38:55:883 c:\projects\webdriver\cpp\iedriver\hookprocessor.cpp(258) Entering HookProcessor::PushData

T 2018-08-08 16:38:55:888 c:\projects\webdriver\cpp\iedriver\hookprocessor.cpp(284) Entering HookProcessor::PullData

D 2018-08-08 16:38:55:888 c:\projects\webdriver\cpp\iedriver\hookprocessor.cpp(290) Waiting for connection from browser via named pipe

T 2018-08-08 16:38:55:888 c:\projects\webdriver\cpp\iedriver\cookiemanager.cpp(438) Entering CookieManager::ThreadProc

Steps to reproduce -

Just try to retrieve the cookies from a site (make sure there are HTTP-only session cookies as well - see the example):

browser.url('https://www.next.co.uk/');
let cookies = browser.cookie(); // gets all cookies - GET request to /session/[session-id]/cookie
jimevans added a commit that referenced this issue Aug 8, 2018
@jimevans
Copy link
Member

jimevans commented Aug 8, 2018

Fixed in 20bdf47. Thank you for the issue report.

@jimevans jimevans closed this as completed Aug 8, 2018
@jimevans
Copy link
Member

jimevans commented Aug 8, 2018

For those keeping score at home, one actual issue had nothing to do with HttpOnly or session cookies. The Windows API used to retrieve the cookie values was returning a NULL pointer for the value property of the cookie, and the IE driver was not properly checking for that before manipulating the value. If this change does not fix the issue, then there's something else happening in a legacy code path.

@savsav
Copy link
Author

savsav commented Aug 9, 2018

Thanks for the quick resolution! Strange that it worked for some sites ("https://www.google.com/" for example) but it didn't work for others - that's why I thought it had something to do with http-only or session cookies.

grigaman pushed a commit to grigaman/selenium that referenced this issue Sep 20, 2018
@lock lock bot locked and limited conversation to collaborators Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants