VBScript to check for Cookies locally without going to the URL

Posted on 2012-08-29
Last Modified: 2013-01-22
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("intro") = "true") then
            'write cookie file
            response.Cookies("IntroVideo") = "true"
            Response.Cookies("IntroVideo").Expires = "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("InternetExplorer.Application")
msie.visible = False
msie.Navigate "https://Intro.url"
Do While msie.Busy
      Sleep 20
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.

Question by:Snappa2000
    LVL 23

    Accepted Solution


    Author Comment

    This will show you the actual files listed in the cookies folder.. They are only DWERTHD.TXT type files, so I cant tell which one is the cookie for the site in reference.

    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.
    LVL 23

    Expert Comment

    by:Roopesh Reddy

    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...
    LVL 53

    Expert Comment

    This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now