how to catch the cookie

Get help with using AutoHotkey and its commands and hotkeys
xuezhe
Posts: 84
Joined: 06 Jan 2016, 11:02

how to catch the cookie

24 Sep 2017, 04:08

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



it can work,but can't catch the cookie I need.

newscreen29589265.jpg
newscreen29589265.jpg (72.92 KiB) Viewed 184 times
egocarib
Posts: 86
Joined: 21 May 2015, 18:21

Re: how to catch the cookie

24 Sep 2017, 09:51

I'm not certain if this will solve your problem, but maybe it will give you a hint.

I had a similar issue trying to log in to a page with HttpRequest. I found that if I sent all the login details (password/username) right away, it always failed. I first needed to SEND the URL without the login details to load the login page and appropriate cookies, then I send the login details (loginBody) after that.

Example excerpt from a script I use:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

xuezhe
Posts: 84
Joined: 06 Jan 2016, 11:02

Re: how to catch the cookie

25 Sep 2017, 09:32

thanks.
I want to set WebRequest.AllowAutoRedirect := false ,but it doesn't works.
tmplinshi
Posts: 1092
Joined: 01 Oct 2013, 14:57

Re: how to catch the cookie

05 Oct 2017, 02:29

The WinHttpRequest object doesn't have AllowAutoRedirect property. But you can use Option property:

Code: [Select all] [Download] GeSHi © Codebox Plus

WebRequest.Option(6) := false ; 6 = WinHttpRequestOption_EnableRedirects


https://msdn.microsoft.com/en-us/library/windows/desktop/aa384108(v=vs.85).aspx wrote:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus




Also, Msgbox % WebRequest.GetResponseHeader("Set-Cookie: ",cookie) is incorrect. Use Msgbox % cookie := WebRequest.GetResponseHeader("Set-Cookie") instead.
xuezhe
Posts: 84
Joined: 06 Jan 2016, 11:02

Re: how to catch the cookie

05 Oct 2017, 04:30

你真是太厉害啦。非常感谢。

Return to “Ask For Help”

Who is online

Users browsing this forum: TAC109 and 43 guests