?
Solved

VBScript to check for Cookies locally without going to the URL

Posted on 2012-08-29
5
Medium Priority
?
669 Views
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
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
0
Comment
Question by:Snappa2000
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
Roopesh Reddy earned 2000 total points
ID: 38345069
0
 

Author Comment

by:Snappa2000
ID: 38345099
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.
0
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 38345319
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...
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 38804714
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

862 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