Cookies from an ASP page coming in weird

Discussion in 'ASP .Net' started by Chris, Feb 16, 2004.

  1. Chris

    Chris Guest

    I have an aspx page that is called from an asp page. When I read the
    httpcookie in asp.net I get the dashes and slashes converted to a "%3" and
    such. Is there was way to convert it back to normal or am I reading in the
    cookie the wrong way?

    This is how I am reading it in

    WorkDir = Request.Cookies("ibWDIR")
    SessionID = Request.Cookies("ibGUID")
    If Not WorkDir Is Nothing Then TextBox1.Text = WorkDir.Value
    If Not SessionID Is Nothing Then TextBox2.Text = SessionID.Value

    This is how I write it form the asp page

    Response.Cookies("ibGUID") = "{56C17EC3-0746-4846-B4EB-7C71FE0948CB}"
    Response.Cookies("ibWDIR") = "f:\ibits\illinois\working"

    Is there an easier/better way to do this?

    Chris
    Chris, Feb 16, 2004
    #1
    1. Advertising

  2. "Chris" <> wrote in news:#F5uA5N9DHA.2944
    @TK2MSFTNGP11.phx.gbl:
    > I have an aspx page that is called from an asp page. When I read the
    > httpcookie in asp.net I get the dashes and slashes converted to a "%3" and
    > such. Is there was way to convert it back to normal or am I reading in the
    > cookie the wrong way?


    Special characters have to be encoded for HTTP/HTML transmission. Look at
    System.Decode.


    --
    Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
    "Programming is an art form that fights back"
    Chad Z. Hower aka Kudzu, Feb 16, 2004
    #2
    1. Advertising

  3. Chris

    Scott M. Guest

    This is normal character encoding. Use Server.URLEncode and
    Server.URLDecode to encode/decode the special characters.


    "Chris" <> wrote in message
    news:%...
    > I have an aspx page that is called from an asp page. When I read the
    > httpcookie in asp.net I get the dashes and slashes converted to a "%3" and
    > such. Is there was way to convert it back to normal or am I reading in

    the
    > cookie the wrong way?
    >
    > This is how I am reading it in
    >
    > WorkDir = Request.Cookies("ibWDIR")
    > SessionID = Request.Cookies("ibGUID")
    > If Not WorkDir Is Nothing Then TextBox1.Text = WorkDir.Value
    > If Not SessionID Is Nothing Then TextBox2.Text = SessionID.Value
    >
    > This is how I write it form the asp page
    >
    > Response.Cookies("ibGUID") = "{56C17EC3-0746-4846-B4EB-7C71FE0948CB}"
    > Response.Cookies("ibWDIR") = "f:\ibits\illinois\working"
    >
    > Is there an easier/better way to do this?
    >
    > Chris
    >
    >
    >
    Scott M., Feb 16, 2004
    #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. Mark Kamoski
    Replies:
    1
    Views:
    7,079
  2. Steve Holden

    PyCon is Coming! PyCon is Coming!

    Steve Holden, Jan 5, 2006, in forum: Python
    Replies:
    0
    Views:
    301
    Steve Holden
    Jan 5, 2006
  3. Ken Fine
    Replies:
    3
    Views:
    565
    Steven Cheng
    Feb 29, 2008
  4. Tazz

    weird program coming on

    Tazz, Jun 6, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    944
  5. _Who
    Replies:
    7
    Views:
    2,638
Loading...

Share This Page