473,396 Members | 1,879 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.

reset cookies

I am modifying the asp.net e-commerce starter kits. I wish to create a
logout routine, so that another user can use the same computer. Currently the
user information and cart information is stored in a cookie.

The approach I am taking is to reset the cookies: basically do the opposite
of this code here:
context.Response.Cookies["ASPNETCommerce_CartID"].Value =
tempCartId.ToString();

but when I try to assign any value the the cookie I am told:
"...Property or indexer 'System.Web.HttpCookieCollection.this[string]'
cannot be assigned to -- it is read only"

TFH
Nov 17 '05 #1
1 4267
Try this:

HttpCookie myCookie = context.Response.Cookies["ASPNETCommerce_CartID"];
myCookie.Value = tempCartId.ToString();
context.Response.Cookies.Set(myCookie);
--

|\/\/\/\/\/|
| | V.V.P.C.K Kiran Kumar
| (o)(o)
c _)
----------------------------------------------------------------------------
----

"ramonred" <ra******@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com...
I am modifying the asp.net e-commerce starter kits. I wish to create a
logout routine, so that another user can use the same computer. Currently the user information and cart information is stored in a cookie.

The approach I am taking is to reset the cookies: basically do the opposite of this code here:
context.Response.Cookies["ASPNETCommerce_CartID"].Value =
tempCartId.ToString();

but when I try to assign any value the the cookie I am told:
"...Property or indexer 'System.Web.HttpCookieCollection.this[string]'
cannot be assigned to -- it is read only"

TFH

Nov 17 '05 #2

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

Similar topics

4
by: Brian Burgess | last post by:
Hi all, Anyone know of any special issues with storing cookies with ASP? I'm trying this with two browsers: One is IE 6.0 with cookies set to 'prompt'. This has been working properly as any...
20
by: Brian Burgess | last post by:
Hi all, Anyone know if this is possible? If so, on which page would the cookie be? .. On the page calling a function defined in the include file? thanks in advance.. -BB
1
by: richard | last post by:
My website uses cookies to persist a certain amount of data on the client. However, occasionally the cookies will disappear or be set to an empty string for no discernable reason. It does not...
6
by: Mark | last post by:
Hi... I've come across some weird bug with Response.Cookies. Or maybe it will be called "by design" but for the life of me I can't figure out what purpose it would serve. If you're setting a...
9
by: YoBro | last post by:
Hi, Is this possible, if so how would you go about it. I have a reasonably large form that includes 6 file input fields. I wanted to create an option to allow the user to reset only the file...
6
by: Stephane | last post by:
Hi, I have a login page where if the user wants his access codes to be saved are set into a cookie. In the logout page, I want to delete those cookies. I tried this and this is not working at...
0
by: Grant Rettke | last post by:
Hi folks, ASP.NET 1.1 question for you folks. I'm working on a web aplication that stores some objects in the session. What is happening is that after I reach a certain page, the session is...
1
by: CADD | last post by:
I've used http://www.bloglines.com to add RSS feeds to my sites there and setup javascript in my website to search bloglines for the input term. The code below works perfect, but I have 1 minor...
0
by: rn5a | last post by:
This is how I am creating & then reading cookies: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) 'create cookies Response.Cookies("UserName").Value = "Ron"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.