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

  2. On 8 Feb., 18:31, "Chris McFarling" <> 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
    Alexey Smirnov, Feb 8, 2010
    #2
    1. Advertising

  3. Chris McFarling

    eppack

    Joined:
    Apr 24, 2012
    Messages:
    1
    Location:
    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")
    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
    eppack, Apr 24, 2012
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Listar
    Replies:
    0
    Views:
    294
    Listar
    Jun 11, 2004
  2. JenAsh
    Replies:
    3
    Views:
    380
    Bruno Desthuilliers
    Jul 25, 2006
  3. Replies:
    1
    Views:
    310
    Robert Kern
    Dec 6, 2006
  4. Chris Chamberlain

    X-MicrosoftAjax header being stripped out by firewalls

    Chris Chamberlain, Sep 25, 2007, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    623
  5. JL

    HTML Stripped from page

    JL, Mar 31, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    117
Loading...

Share This Page