.NETGURU
Updating cookie erases previously set values
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngfreeforall' list.


Casella Ii, Cono
Hi-
I'm setting a cookie as follows:
1: Dim ckCA As New HttpCookie("ckCA")
2: ckCA.Values.Add("ID", CType(m_Prof_ID.ToString, String)) 'm_Prof_ID
is a Guid from a SQL query
3: ckCA.Values.Add("URL", HttpContext.Current.Request.RawUrl)
4: HttpContext.Current.Response.Cookies.Add(ckCA)

Then, I update the ("URL") key in another page:

1: HttpContext.Current.Response.Cookies("ckCA").Values("URL") HttpContext.Current.Request.RawUrl

However, after this, the ("ID") key's value I set upon first creating
the cookie is erased. How can I update one key's value without erasing
the other(s)?

Cono Casella
Computer Associates
Programmer
tel: +1 631 342 6568
fax: +1 631 342 6884
Click here to reveal e-mail address
Reply to this message...
 
    
Suren
Messagetry this

Request.Cookies("ckCA").Values("URL") = HttpContext.Current.Request.RawUrl

----- Original Message -----
From: Casella Ii, Cono
To: aspngfreeforall
Sent: Thursday, August 15, 2002 12:02 PM
Subject: [aspngfreeforall] Updating cookie erases previously set values

Hi-
I'm setting a cookie as follows:
1: Dim ckCA As New HttpCookie("ckCA")
2: ckCA.Values.Add("ID", CType(m_Prof_ID.ToString, String)) 'm_Prof_ID is
a Guid from a SQL query
3: ckCA.Values.Add("URL", HttpContext.Current.Request.RawUrl)
4: HttpContext.Current.Response.Cookies.Add(ckCA)

Then, I update the ("URL") key in another page:

1: HttpContext.Current.Response.Cookies("ckCA").Values("URL") HttpContext.Current.Request.RawUrl

However, after this, the ("ID") key's value I set upon first creating the
cookie is erased. How can I update one key's value without erasing the
other(s)?

Cono Casella
Computer Associates
Programmer
tel: +1 631 342 6568
fax: +1 631 342 6884
Click here to reveal e-mail address

| ASP.net DOCS = http://www.aspng.com/docs | [aspngfreeforall] member
Click here to reveal e-mail address = YOUR ID | http://www.asplists.com/aspngfreeforall = JOIN/QUIT
| news://ls.asplists.com = NEWSGROUP
Reply to this message...
 
 
System.Web.HttpContext
System.Web.HttpCookie




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification