Spaces stripped from cookie value

Discussion in 'ASP .Net' started by Chris McFarling, Feb 8, 2010.

  1. 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:

    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?
    Chris McFarling, Feb 8, 2010
    1. Advertisements

  2. I think they were saved in UTF
    Alexey Smirnov, Feb 8, 2010
    1. Advertisements

  3. Chris McFarling


    Apr 24, 2012
    Likes Received:
    Charlottesville, VA
    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")
    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.


    charlottesville, va
    eppack, Apr 24, 2012
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.