Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Translation of cookie data

    I set a cookie called UserID. The data portion contains this format:

    Domain\UserID

    I set the UserID in the client code using Javascript. When I process the cookie in the xerver code using Visual Basic the backslash (\) translates to %5C. Who is doing this translation and how I can set the \ so that it will be read in the server program as backslash.

    Thank you

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,596
    Thanks
    80
    Thanked 4,633 Times in 4,595 Posts
    *HOW* are you reading the cookie in VB??

    If you are doing it as Request.Cookie("name") then you shouldn't be seeing that.

    If you are trying to read the raw cookie data, then that is correct.

    Cookies are encoded the same way Query Strings and Post data are. In ASP/VBScript code, you can explicitly unencode them using the VBScript function UnEscape but I don't know if VB has that function available.

    Best would be to stop trying to read raw cookie data and allow the ASP Request object to do the decoding for you, if that's an available option for you.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •