charon Posted March 26, 2015 Share Posted March 26, 2015 (edited) 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) Edited March 26, 2015 by charon Link to comment Share on other sites More sharing options...
Bert Posted March 26, 2015 Share Posted March 26, 2015 I've set cookies in javascript but not the way you want. The entire point of setting a cookie is to have the browser do it so the browser knows what to do. Why do you need to do it without the browser? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now