Spaces stripped from cookie value

  • Thread starter Chris McFarling
  • Start date
C

Chris McFarling

I'm using an apsx page to write a date value to a cookie. I then need to
read that cookie with a classic asp page. The value is written correctly to
the cookie. If I view cookies for example in Firefox, it is formatted
properly. When reading the value via asp however, all of the spaces are
stripped out causing it to become an invalid date value.

As written:
2/5/2010 3:23:14 PM

As read:
2/5/20103:23:14PM

As a test I read the value using aspx and it was read correctly. So it
appears to be classic asp related. Any ideas why this is happening?
 
G

Guest

I'm using an apsx page to write a date value to a cookie. I then need to
read that cookie with a classic asp page. The value is written correctly to
the cookie. If I view cookies for example in Firefox, it is formatted
properly. When reading the value via asp however, all of the spaces are
stripped out causing it to become an invalid date value.

As written:
2/5/2010 3:23:14 PM

As read:
2/5/20103:23:14PM

As a test I read the value using aspx and it was read correctly. So it
appears to be classic asp related. Any ideas why this is happening?

I think they were saved in UTF
 
Joined
Apr 24, 2012
Messages
1
Reaction score
0
I'm using an apsx page to write a date value to a cookie. I then need to read that cookie with a classic asp page. The value is written correctly to the cookie. If I view cookies for example in Firefox, it is formatted
properly. When reading the value via asp however, all of the spaces are
stripped out causing it to become an invalid date value.
As written:
2/5/2010 3:23:14 PM
As read:
2/5/20103:23:14PM
As a test I read the value using aspx and it was read correctly. So it
appears to be classic asp related. Any ideas why this is happening?

I am having the exact problem. In Visual Studio 2008, the cookies are created like this:


Response.Cookies( "CommonName").Value = Me .tbCommName.Text.Trim

and I'm trying, rightly or wrongly to retrieve them in my .asp program:


If Request.Cookies ("CommonName") > "" Then
CommonName=Request.Cookies ("CommonName")
else
CommonName=""
End If

This definitely strips out the embedded spaces, too. Some googling has suggested either htmlencode or urlencode, but I'm not sure where or if that should be applied :( Testing didn't work, but I probably didn't do it right, darn it, or in the wrong place.


TIA


elaine
charlottesville, va
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top