472,981 Members | 1,108 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,981 software developers and data experts.

Cookie Handling: Sending saved cookies in httprequest

Not sure I've posted this in the right place but here's the problem.

I've made some progress but I'm stuck. I can find and use the data in a
required cookie and send it in the httprequest as hard-coded for a test. Of
course I need this to be part of the automated request process as if I was
using a
browser. Surely there is a method to automatically find the cookie, extract
the right property and make this happen? I can't find it.

Scenario:
Website uri is http://www.pageiwant.com.
Page I want is http://www.pageiwant.com/here?.php?m=meetup
I have logged in via browser and cookie is set
Cookie is C:\Docs\Own\Cooks\ow***@www.pageiwant[1].txt
Property I want in cookie is ABCD (cookie.name)which has been set to
G7789Ooqdowjkc7rrFA28r5hp0f78e (cookie.value) when the browser was used to
log in to website.

Here is my test code that does the job:

Dim uri As New Uri("http://www.pageiwant.com/here?.php?m=meetup")
Dim cookUri As New Uri("http://www.pageiwant.com")
Dim request As HttpWebRequest
Dim response As HttpWebResponse

Try
request = CType(WebRequest.Create(uri), HttpWebRequest)
request.CookieContainer = New CookieContainer
request.CookieContainer.SetCookies(cookUri,
"ABCD=G7789Ooqdowjkc7rrFA28r5hp0f78e")

'Rest of code goes here

The above authenticates me using the cookie value as if I was using a
browser. What is the best way to automate this for any client machine. There
must be a way :)

TIA

JD/Simon

Jul 21 '05 #1
0 1255

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: N.K | last post by:
Hi , Python's existing cookie module doesnt supports new cookie headers SetCookie2 , How to submit a patch for that ? I tried emailing person who owns that module.But no response. Thanks,...
3
by: M Wells | last post by:
Hi All, Just wondering how you go about changing the value of a session cookie via javascript? I have a PHP page that sets a session cookie when it first loads. I'd like to be able to change...
3
by: Ana | last post by:
I have written some code using transient cookies to send an edited essay from one html page to another. Each paragraph of the essay is saved in separate cookie. If the essay is 4 paragraphs long...
3
by: Eþref DURNA | last post by:
My Aim is to make a windows application download which support session and cookies. There is a web site which gives images as links like this...
0
by: JavaDoc | last post by:
Not sure I've posted this in the right place but here's the problem. I've made some progress but I'm stuck. I can find and use the data in a required cookie and send it in the httprequest as...
9
by: Sullivan WxPyQtKinter | last post by:
I do not want to use Cookies in my site since not all web browser support it well and sometimes people close cookie functioning for security reasons. I tried to add hidden field with a sessionID...
1
by: Joe | last post by:
In ASP.NET 1.1 I could detected expired form authentication tickets (which closely coincide with my expired session) by checking for the Authentication Cookie when the login screen loads. If the...
29
by: Jerim79 | last post by:
I did try to find the answer to this before posting, so this isn't a knee jerk reaction. What I am trying to accomplish is to have a script that opens a cookie, reads a value, and then use a...
2
by: Sean | last post by:
I am trying to read a cookie I set but I am not sure if I really set it correctly or I am not reading it correctly. I was given the following instructions to set the cookie. It appears to be...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.