Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Spaces stripped from cookie value

Reply
Thread Tools

Spaces stripped from cookie value

 
 
Chris McFarling
Guest
Posts: n/a
 
      02-08-2010
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?

 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      02-08-2010
On 8 Feb., 18:31, "Chris McFarling" <(E-Mail Removed)> wrote:
> 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
 
Reply With Quote
 
 
 
 
eppack eppack is offline
Junior Member
Join Date: Apr 2012
Location: Charlottesville, VA
Posts: 1
 
      04-24-2012
Quote:
Originally Posted by Chris McFarling View Post
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSD to allow A-Z 0-9 and spaces, but not leading/trailing spaces johkar XML 2 12-10-2009 09:24 AM
[CSS] how can I show spaces as spaces? Tomasz Chmielewski HTML 21 09-10-2009 06:43 PM
how can I show spaces as spaces, part 2 Tomasz Chmielewski HTML 14 09-10-2009 03:54 PM
Re: How to trim a String trailing spaces, but not leading spaces? Roedy Green Java 3 09-14-2008 02:10 AM
Re: How to trim a String trailing spaces, but not leading spaces? John B. Matthews Java 4 09-12-2008 05:28 AM



Advertisments