Re: Setting cookies on InternetExplorer.Application

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Um, oh yea, in the hopes that IE just needed a concrete
domain, I tried navigating it to a fake domain

ie.Navigate2 "about:blank"
ie.Navigate2 "http://sureNotToExist.com";
while (ie.ReadyState<4): WScript.Sleep(1): Wend

and then set the cookie. Not surprisingly,
this did not work either. It also didn't work
when I tried to execute the cookie script by
means of a window.setTimeout.


On Mar 4, 1:58 pm, Csaba Gabor <dans...@xxxxxxxxx> wrote:
I have a VBScript application I've written which uses IE for
display purposes. I figure, why not retain settings for my
app using IE's already built in handler, namely cookie
management? Unfortunately, I'm getting the big goose egg,
nada, nothing, zip.

Here's what I tried.
....
However, when I convert the above in the hopes
of using it with the IE that my VBScript app brings up, the
cookie appears to never have been set.

'Run this script in a .vbs file
set ie = CreateObject("InternetExplorer.Application")
ie.Navigate2 "about:blank"
ie.visible = True
cookieScript = _
"var exp = new Date();" & _
"var Mins3 = exp.getTime() + (1000 * 60 * 3);" & _
"exp.setTime(Mins3);" & _
"var newCookie=" & _
"'foo=bar; " & _
"expires=' + exp.toGMTString();" & _
"alert ('setting: ' + newCookie);" & _
"document.cookie = newCookie"
ie.document.parentWindow.execScript cookieScript
MsgBox ie.document.cookie
'ie.Quit()

Of course as it sits, this code would be insufficient
because there is nothing to associate the cookie
with the script being run (ie. WScript.ScriptFullName).
Nevertheless, is there a way to get my basic idea to
work?

Thanks,
Csaba Gabor from Vienna
.



Relevant Pages

  • Re: Setting cookies on InternetExplorer.Application
    ... Use the FileSystemObject to read the cookie. ... 'Run this script in a .htm file ... of using it with the IE that my VBScript app brings up, ... MsgBox ie.document.cookie ...
    (microsoft.public.scripting.vbscript)
  • IE dot bug - Sandblad advisory #7
    ... Initially reported to Microsoft about the dot bug vulnerability. ... Microsoft released patch: ... Files in the cookie directory are not treated as beeing in the ... Remote webpage can script in local zone" ...
    (Bugtraq)
  • Re: Parameter quires in Data access pages
    ... script code from the DAP that writes the cookie to the PC: ... This is the script that reads, writes, and deletes cookies on the PC: ... button on the DAP, and then navigates to the "show me" DAP: ... <MS ACCESS MVP> ...
    (microsoft.public.access.dataaccess.pages)
  • Re: Parameter quires in Data access pages
    ... "Ken Snell (MVP)" wrote: ... script code from the DAP that writes the cookie to the PC: ... This is the script that reads, writes, and deletes cookies on the PC: ...
    (microsoft.public.access.dataaccess.pages)
  • [NEWS] XSS Vulnerability in Major Websites (Hotmail, Yahoo and Excite)
    ... *.msn.com the cookie for the email service can be captured. ... XSS is in the 'article.asp' script on 'www.accesshollywood.msn.com'. ... The yahoo mail service uses a *.yahoo.com server, ...
    (Securiteam)