Updating cookie

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

I have a cookie that is set by an ASP page. I can read it fine in my ASPX
page, but the update does not seem to work. Any ideas? Here's the code:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' Get the cookie value
Dim i As Short = Request.Cookies("NumVisits").Value()

' Write it to the screen
Response.Write(i)

' Increment the value by 1
Request.Cookies("NumVisits").Value = i + 1
End Sub
 
Sorry, when I write the cookie I meant to use this:
Response.Cookies("NumVisits").Value = i + 1

But, it still doesn't work. Any ideas?
 

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

Similar Threads

Cookies Count 2
Request.Cookies? 3
What's wrong with this code? 2
ASP.Net cookie -> ASP -> ASP.Net 3
Cookies and Events Problems 1
double cookie 2
Cookies 1
Cookies 1

Back
Top