
December 12th, 2007, 06:45 AM
|
|
Registered User
|
|
Join Date: Dec 2007
Posts: 1
Time spent in forums: 24 m 22 sec
Reputation Power: 0
|
|
|
VbScript - how to get cookies from website
Hi, I'm a noob here, so if this post is in the wrong place or whatever, please let me know.
I've got a vbscript that is logging me into a website and getting some info. The problem is I can't seem to transfer the cookie from the login process to the process to ask for the page I need. Also, the cookie expires every 24 hours and I have to have the script log me back in.
I'm using the ServerXMLHTTP 3 object. It gets and and resends the cookies that the server sets when it is getting the pages I need. However, I can't figure out how to access those cookies it is storing so that I can put them in my script as a variable. MAke sense?
I'll explain it step by step.
1. My script posts user creds to the webserver's login page
2. WebServer redirects login request to another page and uses Set-Cookie to write a cookie to my machine.
3. My script is redirected via 302's a few times (to set other cookies which seem to be irrelevant) until it gets to the page it wants.
The problem is I can't get a hold of the cookie and put it in a variable or write it to a file so I can call it up next time the script runs. I have tried the serverXMLHTTP.getallHeaders (or whatever it's called). The cookies don't show up becuase they belong to the client(the script) and I in a week I haven't been able to figure out how to access them.
Please put me out of my misery! It's probably simple, or impossible.
THanks
Saffir
|