Re: HTTPWebRequest + Cookies problem

From: Vitaly Filimonov [MSFT] (vitalyf_at_online.microsoft.com)
Date: 02/21/04


Date: Fri, 20 Feb 2004 20:22:24 -0800

Hello,

  It appears that you are using cookie-based authentication. If so, your
login web request should return you a cookie which has login ticket or
something like that. You can extract that cookie using
HttpWebResponse.Cookies collection. You'll need to add that cookie with its
content using HttpWebRequest.CookieContainer for all subsequent requests.
Tihs way your web request will contain required cookie(s) and web server
auth module will be able to test that you're logged in.

  I can work on a little example of that if you can't get your process to
work...

-- 
Vitaly.
-------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
"Ori" <orianavim@hotmail.com> wrote in message
news:b431a203.0402171616.40af87e8@posting.google.com...
> Hi,
>
> In continue to another post which I have in this news group, I was
> able to find out some more details about the problem
>
> What is my problem?
>
> I currently build some kind of web-service which illustrates the
> web-site login, some query and retrieve some data from this websites.
>
> I have a website which I'm not able to login into (although I pass all
> the variables which need to be sent) and I'm getting the same error:
> "Your session has expired. Please login again.".
>
> The wired part that if I'm taking the URL which I generate, and place
> it in the IE browser, I'm login successfully, but when I'm using is
> through the HTTWebRequest (doesn't matter if I'm using GET/POST)  I'm
> not able to login.
>
> What I've found so far?
>
> From what I was able to figure out, it's something which related to
> cookies. If I'm disabling the cookies on my IE I see that I'm not able
> to login to the website (get the same error message).
> Nevertheless, when I enables the cookies (and also succeed to login to
> the website) I wasn't able to see any cookie in my cookies folder
> which belongs to this website.
>
> Is there any setting which I need to set in my HTTWebRequest object in
> order to enable cookies or something like that? Does anyone has any
> idea how to solve my problem ?
>
> Thanks,
>
> Ori.


Relevant Pages

  • HTTPWebRequest + Cookies problem
    ... I have a website which I'm not able to login into (although I pass all ... If I'm disabling the cookies on my IE I see that I'm not able ... order to enable cookies or something like that? ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • HTTPWebRequest + Cookies problem
    ... I have a website which I'm not able to login into (although I pass all ... If I'm disabling the cookies on my IE I see that I'm not able ... order to enable cookies or something like that? ...
    (microsoft.public.dotnet.general)
  • HTTPWebRequest + Cookies problem
    ... I have a website which I'm not able to login into (although I pass all ... If I'm disabling the cookies on my IE I see that I'm not able ... order to enable cookies or something like that? ...
    (microsoft.public.dotnet.general)
  • Re: Help trying to login to myspace programatically in vb.net
    ... 'Dim myspacecookies As New Net.CookieContainer ... you should get the login page from a config file. ... Dim response As System.Net.WebResponse = Nothing ... ' You need to capture the cookies at this point and use ...
    (microsoft.public.dotnet.general)
  • Re: login OWA of Exchange 2007 using .NET2003
    ... Actually the objective of my ASP.NET program is to login the FBA page ... then I will implant the cookies returned to the user's browser, ... it seems it has already logined the OWA. ... // implant the cookies returned from exchange server to user's browser ...
    (microsoft.public.exchange.development)

Quantcast