Web request with an existing cookie...

G

Guest

Hi,

I'm writing a small c# app to test response times of specific pages of a
website. What I need to know is when I make the request to a restricted page
can I pass an authentication cookie that all ready exists on my hard drive
rather than go through a whole login process to capture the cookie? I suspect
that this isn't an option but it would save me a whole world of time if it
was.

Thanks in advance for any help, Andy
 
D

David Lloyd

Andy:

My understanding is that it depends on the type of authentication you are
using. The CrendentialCache is used to store login credentials for multiple
resources.

This issue was addressed in the June, 2005 Web Q&A section of MSDN magazine.
Please see the following link for more information and a code sample.

http://msdn.microsoft.com/msdnmag/issues/05/06/WebQA/default.aspx

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Hi,

I'm writing a small c# app to test response times of specific pages of a
website. What I need to know is when I make the request to a restricted page
can I pass an authentication cookie that all ready exists on my hard drive
rather than go through a whole login process to capture the cookie? I
suspect
that this isn't an option but it would save me a whole world of time if it
was.

Thanks in advance for any help, Andy
 
G

garethdjames

Usualy credential cookies are linked to sessions, when a session
expires so does the cookie
 
G

Guest

Thank you for your comments David. The site whose page I am trying to poll is
an asp website that is using forms authentication. I believe that once the
login form is submitted a session cookie is written back that is used to
authenticate the user. What I would ideally like to do is manually login to
the site to get the cookie on my hard drive then kick off my app using this
cookie to repeatedly poll the response time for a specified restricted page.
 
J

Joerg Jooss

Andy said:
Thank you for your comments David. The site whose page I am trying to
poll is an asp website that is using forms authentication. I believe
that once the login form is submitted a session cookie is written
back that is used to authenticate the user. What I would ideally like
to do is manually login to the site to get the cookie on my hard
drive then kick off my app using this cookie to repeatedly poll the
response time for a specified restricted page.

You can do this using HttpWebRequest/HttpWebResponse.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top