473,396 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Updating cookie

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
Nov 18 '05 #1
1 1248
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?

"VB Programmer" <gr********@go-intechN0SPAM.com> wrote in message
news:u$**************@TK2MSFTNGP09.phx.gbl...
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

Nov 18 '05 #2

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

Similar topics

1
by: Rossz | last post by:
I'm trying to implement a 30 day cookie to store a code related to our affiliate program. I have this: $pid = $_GET; if (!is_null($pid)) { setcookie('PID',$pid, time()+60*60*24*30, "/"); }...
0
by: Chad Richardson | last post by:
Got a cookie problem, specifically with persisting it when I write to it a second time on another ASP page. Here's the scenario: Page1.asp: - I have a cookie with serveral keys - I set all the...
5
by: brettr | last post by:
When I reference document.cookie, there is a long string of key=value; pairs listed. I may have 100 hundred cookies on my hard drive. However, most only have one key=value pair. Does the...
4
by: socialism001 | last post by:
I'm trying to store a value in a cookie but its not working. Can anyone see what I might be doing wrong. Thanks, Chris ~~~~~~~~~~~~~~~~~~ <script language="javascript">...
9
by: Marco Krechting | last post by:
Hi All, I have a page with a list of hyperlinks. I want to save information in a cookie about the fact that I entered an hyperlink or not. When I click one of the hyperlinks I want this stored...
0
by: Denver Developer | last post by:
I have a cookie that is set by a previous ASP page that I wish to update with the following logic. MyCookieColl = Request.Cookies; for (loop1 = 0; loop1 < MyCookieColl.Count ; loop1++) {...
3
by: StevenT | last post by:
Hello, I am trying to dynamically create a table based on the information I have in my cookie for a shopping cart. I can create it and display it and all is good. I put the contents of the...
0
by: TechnoAtif | last post by:
<?php include "dbconnect.php"; include "commonFunc.php"; ?> <!----------------------------------> <table width="80%" border="1" cellpadding="2" cellspacing="0"> <tr > <td...
16
by: Stevo | last post by:
I'm guessing this is a laughably obvious answer to many here, but it's not to me (and I don't have a server or any knowledge of PHP to be able to try it). It's not strictly a PHP question, but...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.