Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

How to set a cookie

$
0
0

I am trying to set a local cookie preferably without opening the browser window.  I can see how to read a cookie but setting a cookie is not clear.

#include <msgboxConstants.au3> #include <Array.au3> #include <IE.au3> Global $oIE = _IECreate("google.com") Global $oCookie = $oIE.document.cookie msgbox($MB_SYSTEMMODAL, "", $oCookie) ; check for string Global $oCookieValues = StringSplit($oCookie, ";") _ArrayDisplay($oCookieValues) ; check for Array ;$oIE.document.cookie = name1=value1;name2=value2 $oIE.document.cookie = myCookie=test;name2=value2

I think this will set my cookie?

$oIE = _IECreate("www.google.com") $oIE.document.cookie = "test_cookie=one; path=/;" ConsoleWrite($oIE.document.cookie & @CRLF) $oIE.document.cookie = "test_cookie=two; path=/;" ConsoleWrite($oIE.document.cookie & @CRLF) _IEQuit($oIE)

Viewing all articles
Browse latest Browse all 12506

Trending Articles