Snappa2000
asked on
VBScript to check for Cookies locally without going to the URL
To anyone,
I need to verify the existence of a cookie, but prefer not navigating to the site.
On the site in the ASP code we have when queried with https://Intro.url?intro=true:
if (request.querystring("intr o") = "true") then
'write cookie file
response.Cookies("IntroVid eo") = "true"
Response.Cookies("IntroVid eo").Expir es = "01 Jan 2014"
This sets the cookie for the user and works fine.. as going back to the page proves that...
Under the local script (.VBS) / wscript, the only way to verify the cookie exists is the below code:
Set msie = Wscript.CreateObject("Inte rnetExplor er.Applica tion")
msie.visible = False
msie.Navigate "https://Intro.url"
Do While msie.Busy
Sleep 20
Loop
IntroCookie = "NotHere"
IntroCookie= msIe.Document.cookie
In the IntroCookie is the contents of the cookie.
How can I prevent the need to navigate to the https://Intro.url, and just check if the cookie exists locally for the user??
If this cant be done via WScript, can someone let me know via what.
Cheers
I need to verify the existence of a cookie, but prefer not navigating to the site.
On the site in the ASP code we have when queried with https://Intro.url?intro=true:
if (request.querystring("intr
'write cookie file
response.Cookies("IntroVid
Response.Cookies("IntroVid
This sets the cookie for the user and works fine.. as going back to the page proves that...
Under the local script (.VBS) / wscript, the only way to verify the cookie exists is the below code:
Set msie = Wscript.CreateObject("Inte
msie.visible = False
msie.Navigate "https://Intro.url"
Do While msie.Busy
Sleep 20
Loop
IntroCookie = "NotHere"
IntroCookie= msIe.Document.cookie
In the IntroCookie is the contents of the cookie.
How can I prevent the need to navigate to the https://Intro.url, and just check if the cookie exists locally for the user??
If this cant be done via WScript, can someone let me know via what.
Cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
I found that solution as the feasible one, other than the one which you have already implemented!
Moreover, you need site name to get the cookie information according to my knowledge. So i feel the original implementation should be fine in this scenario!
Hope it helps u...
I found that solution as the feasible one, other than the one which you have already implemented!
Moreover, you need site name to get the cookie information according to my knowledge. So i feel the original implementation should be fine in this scenario!
Hope it helps u...
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
ASKER
If I can workout for https://Intro.url the corresponding cookie file is TYHSWRP.txt then its fine.. but this will different for every user and machine.