473,568 Members | 2,964 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multiple cookies with same name, why?

in the trace information
i am getting the following:

userID 81
username nick.......
projID 1
ProjName Jupiter
inDus 4F2EA4.........
ASP.NET_Session Id 0vg5mca.....
ProjID 2
ProjName Vis
ProjID 6

as you can see there are multiple instances of the same thing
which is no use to me as I am trying to track what the user
is doing by storing certain attributes in cookies

here is a sample of how i am adding the cookies [c#]:
System.Web.Http Cookie ProjName = new System.Web.Http Cookie("ProjNam e");

ProjName.Value = DdlProjects.Sel ectedItem.Text;

ProjName.Expire s = DateTime.Now.Ad dDays(30);

System.Web.Http Cookie ProjID = new System.Web.Http Cookie("ProjID" );

ProjID.Value = DdlProjects.Sel ectedItem.Value ;

ProjID.Expires = DateTime.Now.Ad dDays(30);

Response.Cookie s.Add(ProjName) ;

Response.Cookie s.Add(ProjID);
this would explain some of the problems i have been having but is there no
way to overwrite the contents
of an existing value?

--
#-)
Nov 18 '05 #1
3 7618
its because the page is being called twice
not sure why this is happening either as the code that writes cookies is
wrapped in a !postback section

hmmm......
"evolve" <NOngnSPAMpeaSP AMrseNO_S__PAMh otmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
in the trace information
i am getting the following:

userID 81
username nick.......
projID 1
ProjName Jupiter
inDus 4F2EA4.........
ASP.NET_Session Id 0vg5mca.....
ProjID 2
ProjName Vis
ProjID 6

as you can see there are multiple instances of the same thing
which is no use to me as I am trying to track what the user
is doing by storing certain attributes in cookies

here is a sample of how i am adding the cookies [c#]:
System.Web.Http Cookie ProjName = new System.Web.Http Cookie("ProjNam e");

ProjName.Value = DdlProjects.Sel ectedItem.Text;

ProjName.Expire s = DateTime.Now.Ad dDays(30);

System.Web.Http Cookie ProjID = new System.Web.Http Cookie("ProjID" );

ProjID.Value = DdlProjects.Sel ectedItem.Value ;

ProjID.Expires = DateTime.Now.Ad dDays(30);

Response.Cookie s.Add(ProjName) ;

Response.Cookie s.Add(ProjID);
this would explain some of the problems i have been having but is there no
way to overwrite the contents
of an existing value?

--
#-)

Nov 18 '05 #2
found out why:

the thing that was writing the cookies out was when the user selected
something from a drop down
however
when the page is originally loaded
the previously chosen value(if exists) is then selected

this appears to call the drop down selected index changed function (even
though the user isn't driving it)
so i just put a
if(page.ispostb ack)
around the inside of the function and now it works fine

"evolve" <NOngnSPAMpeaSP AMrseNO_S__PAMh otmail.com> wrote in message
news:eB******** ******@TK2MSFTN GP09.phx.gbl...
its because the page is being called twice
not sure why this is happening either as the code that writes cookies is
wrapped in a !postback section

hmmm......
"evolve" <NOngnSPAMpeaSP AMrseNO_S__PAMh otmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
in the trace information
i am getting the following:

userID 81
username nick.......
projID 1
ProjName Jupiter
inDus 4F2EA4.........
ASP.NET_Session Id 0vg5mca.....
ProjID 2
ProjName Vis
ProjID 6

as you can see there are multiple instances of the same thing
which is no use to me as I am trying to track what the user
is doing by storing certain attributes in cookies

here is a sample of how i am adding the cookies [c#]:
System.Web.Http Cookie ProjName = new System.Web.Http Cookie("ProjNam e");

ProjName.Value = DdlProjects.Sel ectedItem.Text;

ProjName.Expire s = DateTime.Now.Ad dDays(30);

System.Web.Http Cookie ProjID = new System.Web.Http Cookie("ProjID" );

ProjID.Value = DdlProjects.Sel ectedItem.Value ;

ProjID.Expires = DateTime.Now.Ad dDays(30);

Response.Cookie s.Add(ProjName) ;

Response.Cookie s.Add(ProjID);
this would explain some of the problems i have been having but is there no way to overwrite the contents
of an existing value?

--
#-)


Nov 18 '05 #3
found out why:

the thing that was writing the cookies out was when the user selected
something from a drop down
however
when the page is originally loaded
the previously chosen value(if exists) is then selected

this appears to call the drop down selected index changed function (even
though the user isn't driving it)
so i just put a
if(page.ispostb ack)
around the inside of the function and now it works fine

"evolve" <NOngnSPAMpeaSP AMrseNO_S__PAMh otmail.com> wrote in message
news:eB******** ******@TK2MSFTN GP09.phx.gbl...
its because the page is being called twice
not sure why this is happening either as the code that writes cookies is
wrapped in a !postback section

hmmm......
"evolve" <NOngnSPAMpeaSP AMrseNO_S__PAMh otmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
in the trace information
i am getting the following:

userID 81
username nick.......
projID 1
ProjName Jupiter
inDus 4F2EA4.........
ASP.NET_Session Id 0vg5mca.....
ProjID 2
ProjName Vis
ProjID 6

as you can see there are multiple instances of the same thing
which is no use to me as I am trying to track what the user
is doing by storing certain attributes in cookies

here is a sample of how i am adding the cookies [c#]:
System.Web.Http Cookie ProjName = new System.Web.Http Cookie("ProjNam e");

ProjName.Value = DdlProjects.Sel ectedItem.Text;

ProjName.Expire s = DateTime.Now.Ad dDays(30);

System.Web.Http Cookie ProjID = new System.Web.Http Cookie("ProjID" );

ProjID.Value = DdlProjects.Sel ectedItem.Value ;

ProjID.Expires = DateTime.Now.Ad dDays(30);

Response.Cookie s.Add(ProjName) ;

Response.Cookie s.Add(ProjID);
this would explain some of the problems i have been having but is there no way to overwrite the contents
of an existing value?

--
#-)


Nov 18 '05 #4

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

Similar topics

0
1694
by: Shagshag | last post by:
hello, how can i set multiple cookies like : Set-Cookie: cookiename1=value1; expires=Tue, 31-Mar-09 11:17:43 GMT; path=/; domain=www.domain.com Set-Cookie: cookiename2=value2; expires=Tue, 31-Mar-09 11:17:43 GMT; path=/; domain=www.domain.com to a httplib.HTTPConnection ?
1
9572
by: mark.reichman | last post by:
First off.. Thanks to Grant Wagner for help in a previous thread related to this one. I am at a total loss... I have multiple fields in a form with the same name. Lets call the fields with the same name "junk_array". My first field of junk_array is a input type=hidden. All the others fields in junk_array that follow are type=text. I can...
12
9359
by: williamc | last post by:
Is there anything wrong with having several classes with the same name in the same style sheet? Something like... div.pagedown { margin: 20px 0px 20px 0px; border-top: 1px solid #caa; border-left: 1px solid #caa; width: 450px; }
2
3132
by: Jeff | last post by:
I'm trying to create a dynamic form that can have multiple groups of radio buttons (each group has two buttons) with the same name. Essentially, the form allows a user to enter as many names as they want. If they need to add more, they click an "add name" button and the javascript inserts another row of input boxes. Each row should have...
17
16151
by: wolfing1 | last post by:
Like, I know if several checkboxes have the same name, I can get the ones that were checked after submit with a request.form("name") and maybe do a split(request.form("name"),",") to cycle through them. I tried the same thing with textfields (input type=text), but doesn't seem to work the same. Do they behave differently?
6
3656
by: DJones | last post by:
I'm using the following code in my .Net application (.Net v1.1, Windows 2000) to write Session Cookies. HttpContext.Current.Response.Cookies("cookieSession")("SessionID") = strSessionID HttpContext.Current.Response.Cookies("cookieSession")("Site_ID") = strSite_ID
0
1135
by: mavrick_101 | last post by:
Hi, I thought we can not have multiple cookies with same name and in case you add a cookie with same name, it would overwrite the previous one. But when I write the cookies from cookie collection I see multiple cookies with same name. Whats going on. I'm confused.
0
1274
by: Moskie | last post by:
I have a form where the user is able to provide an arbitrary number of attachments. This is done through Javascript that dynamically generates INPUT fields, each of which has the NAME attribute set to the same value. Now on the server side processing of this form, how do I handle these posted files, each of which has the same name? I was...
17
17025
by: Sam Kong | last post by:
Hello, There are 1 or more select elements with the same name in a form. Let's say that the name of the select is 'select1' and the name of the form is 'form1'. If there's only one select I access it like form1.select1. If there are more than one select, I access them like form1.select1. To check if there are more than one, I thought I...
5
14794
HaLo2FrEeEk
by: HaLo2FrEeEk | last post by:
I've been using stream_context_create() to send cookies along with a file_get_contents() call when requesting a remote page. This is useful if I need to pass information to the remote page that my server can't pass, like a login form. This works perfectly well when I've got a single cookie, or multiple cookies on the same domain and path, but...
0
7604
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8117
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6275
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.