Link to home
Start Free TrialLog in
Avatar of Woroworo
WoroworoFlag for Nigeria

asked on

How do I use windows application to read a cookie entry created by a specific web application

I want to know how to use windows application to read a cookie entry created by a specific web application

The code below is from a web application. It creates the cookie entry if it does not already exist.

        If Not Page.IsPostBack Then

            Dim myCookie As HttpCookie = New HttpCookie("MyCode")
            If (Request.Cookies("MyCode") IsNot Nothing AndAlso Request.Cookies("MyCode").Value > 0) Then
                Dim mCode As String = ""
                urlStr = Request.Cookies("MyCode").Value
                Response.Cookies("MyCode").Expires = Now.AddDays(-2)
            Else
                myCookie.Value = "Test01"
                myCookie.Expires = Now.AddDays(365)
                Response.Cookies.Add(myCookie)
            End If
        End If

I want a windows application that will only read the entry for a decision to be taken.

Thanks.
Avatar of Gary Davis
Gary Davis
Flag of United States of America image

The web app creates the cookie on the client's browser. The windows app will have to run on the client's PC to get to the cookie. It can not run on the web server. Is that what you want to do?
Each browser may implement its cookie storage differently so the windows app will have to be tailored to the browser being used (IE, Firefox, etc). There are cookie apps that are able do that for various browsers. For some examples, see:
http://www.freedownloadscenter.com/Network_and_Internet/Cookie_and_Cache_Managers/
Gary Davis
Avatar of Woroworo

ASKER

>>The web app creates the cookie on the client's browser. The windows app will have to run on the client's PC to >>get to the cookie. It can not run on the web server. Is that what you want to do?

Yes. I want the windows app to to run on the client's PC.

Thanks.
I want the windows app to be an independent program running on the client's PC. This is because the output of the reading will determine the decision to be taken within that same windows app.

Thanks.
Avatar of dexion432
dexion432

Make a simple windows application which reads the cookies directory and searches for the cookie.

ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks so much. It really solved my problem. God bless you.