473,405 Members | 2,262 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,405 software developers and data experts.

Missing data in cookie

I have a record set (rs) that contains 25 barcodes values that I set to true
in a cookie. (see code section below)

If I read the cookie from within the same page that created it, I see all
25 values. But if I redirect to another page and read the cookie only 18 of
the values remain.

Even though I load the same 25 barcodes at login, the 18 that remain can
differ each time.

If anyone can help figure out why I am missing data in the cookie, I would
appreciated it. The cookie size is only 2k.

Here is the section of code i am using to create the cookie. Hopefully, I
did not make any typos when I retyped it.

while not rs.eof
response.cookies(cstr(rs("code"))) = "true"
response.cookies(cstr(rs("code"))).expires = dateadd("d",1,date)
rs movenext
wend

Here is the section of code i am using to view the cookie.

for each cookie in Request.cookies
if not request.cookies(cookie).haskeys then
response.write "<br>"
response.write cookie + " = " + request.cookies(cookie)
else
for each key in request.cookies(cookie)
response.write "<br>"
response.write cookie + "( "+ key + ") = " +
request.cookies(cookie)(key)
next
end if
next
Jul 22 '05 #1
4 1635
> Here is the section of code i am using to create the cookie. Hopefully, I
did not make any typos when I retyped it.
Are your Ctrl, C or V keys broken?
while not rs.eof
response.cookies(cstr(rs("code"))) = "true"
response.cookies(cstr(rs("code"))).expires = dateadd("d",1,date)
rs movenext
wend

Here is the section of code i am using to view the cookie.

for each cookie in Request.cookies
if not request.cookies(cookie).haskeys then
response.write "<br>"
response.write cookie + " = " + request.cookies(cookie)
else
for each key in request.cookies(cookie)
response.write "<br>"
response.write cookie + "( "+ key + ") = " +
request.cookies(cookie)(key)
next
end if
next


I will try this tomorrow when I'm on a PC but it looks like it should work.
In other words, on casual inspection, I can't see why 7 of the codes would
randomly disappear.

A

Jul 22 '05 #2
when you say the data is only 2k, are you also taking into account the
cookies keys (names) and the expires date?

anyway, I'd recommend you keep the amount of data in the coookie to an
absolute minimum and use an alternative, say Session variables, or persisted
data in a DB, or application/session-scope FreeThreadedDomDocuments if you
want to persist bigger chunks of data
--
Jason Brown
Microsoft GTSC, IIS

This posting is provided "AS IS" with no warranties, and confers no
rights.

"Wally" <Wa***@discussions.microsoft.com> wrote in message
news:C7**********************************@microsof t.com...
I have a record set (rs) that contains 25 barcodes values that I set to
true
in a cookie. (see code section below)

If I read the cookie from within the same page that created it, I see all
25 values. But if I redirect to another page and read the cookie only 18
of
the values remain.

Even though I load the same 25 barcodes at login, the 18 that remain can
differ each time.

If anyone can help figure out why I am missing data in the cookie, I would
appreciated it. The cookie size is only 2k.

Here is the section of code i am using to create the cookie. Hopefully, I
did not make any typos when I retyped it.

while not rs.eof
response.cookies(cstr(rs("code"))) = "true"
response.cookies(cstr(rs("code"))).expires = dateadd("d",1,date)
rs movenext
wend

Here is the section of code i am using to view the cookie.

for each cookie in Request.cookies
if not request.cookies(cookie).haskeys then
response.write "<br>"
response.write cookie + " = " + request.cookies(cookie)
else
for each key in request.cookies(cookie)
response.write "<br>"
response.write cookie + "( "+ key + ") = " +
request.cookies(cookie)(key)
next
end if
next

Jul 22 '05 #3
Using windows explorer the cookie file size shows as 2k.

This is existing code that I have inherited. I have suggested using session
variables to my client, but this would require code changes in 30 or more asp
pages and he wants me to spend a little more time trying to find this bug.
"Jason Brown [MSFT]" wrote:
when you say the data is only 2k, are you also taking into account the
cookies keys (names) and the expires date?

anyway, I'd recommend you keep the amount of data in the coookie to an
absolute minimum and use an alternative, say Session variables, or persisted
data in a DB, or application/session-scope FreeThreadedDomDocuments if you
want to persist bigger chunks of data
--
Jason Brown
Microsoft GTSC, IIS

This posting is provided "AS IS" with no warranties, and confers no
rights.

"Wally" <Wa***@discussions.microsoft.com> wrote in message
news:C7**********************************@microsof t.com...
I have a record set (rs) that contains 25 barcodes values that I set to
true
in a cookie. (see code section below)

If I read the cookie from within the same page that created it, I see all
25 values. But if I redirect to another page and read the cookie only 18
of
the values remain.

Even though I load the same 25 barcodes at login, the 18 that remain can
differ each time.

If anyone can help figure out why I am missing data in the cookie, I would
appreciated it. The cookie size is only 2k.

Here is the section of code i am using to create the cookie. Hopefully, I
did not make any typos when I retyped it.

while not rs.eof
response.cookies(cstr(rs("code"))) = "true"
response.cookies(cstr(rs("code"))).expires = dateadd("d",1,date)
rs movenext
wend

Here is the section of code i am using to view the cookie.

for each cookie in Request.cookies
if not request.cookies(cookie).haskeys then
response.write "<br>"
response.write cookie + " = " + request.cookies(cookie)
else
for each key in request.cookies(cookie)
response.write "<br>"
response.write cookie + "( "+ key + ") = " +
request.cookies(cookie)(key)
next
end if
next


Jul 22 '05 #4
Wally wrote:
I have a record set (rs) that contains 25 barcodes values that I set
to true in a cookie. (see code section below)

If I read the cookie from within the same page that created it, I
see all 25 values. But if I redirect to another page and read the
cookie only 18 of the values remain.

Even though I load the same 25 barcodes at login, the 18 that remain
can differ each time.


Have you confirmed this with any other browser, or just with IE?

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 22 '05 #5

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

Similar topics

1
by: Vikram Bhatia | last post by:
In my web application we are able to store large data in the browser cookie keeping in mind the limit of 300 cookies per cookie file, 20 keys per cookie per domain and 4KB max size of each cookie....
1
by: ERamirez | last post by:
I downloaded the Portal Starter Kit of http://asp.net and started adding a few modules. All debuggin localy worked fine but once I put it onto a Windos Server 2003 I keep getting the following...
0
by: Shane Thomas | last post by:
Hello everyone. I'm hoping somebody can explain why this is happening. I'm collecting pages from several different sites and one of the sites returns an HttpWebResponse object with these...
0
by: Laura K | last post by:
I am working with a shopping cart (I am suing a book). At this point I am trying to add the cartID, the productID, quantity and time. At the same time it is supposed to add a cookie. When I...
0
by: Chris Newby | last post by:
I'm looking for a way to transparently encrypt cookie data using Asp.Net 1.1. Ideally, developers could still do things like: HttpCookie cookie = new HttpCookie( "clearTextKey",...
4
by: rgparkins | last post by:
Hello I am running out of time with a problem I have running PHP 5.04 and Apache 2.0 and really need help :(. I have a page that stores a variable in session but each time I reload that page the...
18
by: Vic Spainhower | last post by:
Hello, Can someone tell me why on some computers the following list will fail . I have a user reported that some of the links in the below list will fail and some will work. The ones that fail...
5
by: sophie_newbie | last post by:
Does anyone know how to do this? I can't seem to make it work. I'm using: c = Cookie.SimpleCookie() c = "unamepwordwhatever" c.expires = time.time() + 300 print c
5
by: bgold12 | last post by:
When a user logs onto my site, I set some session data using php: .... session_start(); .... $_SESSION = 'value'; .... From what I understand, this should store the session data (i.e. the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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.