cookie returns hex code for special characters

hi All,
when i am writing a cookie with value such as : !qwE1+*=
the server creates that cookie fine
but , when i am trying to get that cookie back or when i open it with notepad
the values inside are inserted hexadecimal as follow :
x0021qwE1x002bx002ax003d

what can i do to get the characters normaly
thanks
Avi Algaly
aaviAsked:
Who is Participating?
 
fritz_the_blankConnect With a Mentor Commented:
Sorry, I had a brain fart there, I meant to post:

    Set app = Server.CreateObject("com.citrix.nfuse.App")
    If Not Request.ServerVariables("REQUEST_METHOD") = "POST" Then
         user = Request.Cookies("NFuseData")("NFuse_User")
         domain = Request.Cookies("NFuseData")("NFuse_Domain")
         password = Request.Cookies("NFuseData")("NFuse_Password")
    Else
         user = Server.HTMLEncode(Request.Form("user"))
         domain = Server.HTMLEncode(Request.Form("domain"))
         password = Server.HTMLEncode(Request.Form("password"))
         response.Write(user&"<br>"&password&"-->from form")
         If (user = "") Then
              response.Write("Problem Occured ")
              response.end
         Else
              Response.Cookies("NFuseData")("NFuse_User") = user
              Response.Cookies("NFuseData")("NFuse_Domain") = domain
              Response.Cookies("NFuseData")("NFuse_Password") = password
                        End If
    End If



Fritz the Blank
0
 
fritz_the_blankCommented:
When you read your cookie, try using the unescape function:

strText = unescape(document.cookie)

Fritz the Blank
0
 
aaviAuthor Commented:
Hi Fritz the Blank
it doesnt work
here's the code
     Set app = Server.CreateObject("com.citrix.nfuse.App")
     If Not Request.ServerVariables("REQUEST_METHOD") = "POST" Then
          user = Request.Cookies("NFuseData")("NFuse_User")
          domain = Request.Cookies("NFuseData")("NFuse_Domain")
          password = Request.Cookies("NFuseData")("NFuse_Password")
     Else
          user = unescape(app.urlEncode(Request.Form("user")))
          domain = unescape(app.urlEncode(Request.Form("domain")))
          password = unescape(app.urlEncode(Request.Form("password")))
          response.Write(user&"<br>"&password&"-->from form")
          If (user = "") Then
               response.Write("Problem Occured ")
               response.end
          Else
               Response.Cookies("NFuseData")("NFuse_User") = user
               Response.Cookies("NFuseData")("NFuse_Domain") = domain
               Response.Cookies("NFuseData")("NFuse_Password") = password
                         End If
     End If
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
fritz_the_blankCommented:
Actually, that code I gave you was client-side javascript. For server side coding, you could try:

Server.HTMLEncode

Fritz the Blank
0
 
fritz_the_blankCommented:
Is this any better?

    Set app = Server.CreateObject("com.citrix.nfuse.App")
    If Not Request.ServerVariables("REQUEST_METHOD") = "POST" Then
         user = Request.Cookies("NFuseData")("NFuse_User")
         domain = Request.Cookies("NFuseData")("NFuse_Domain")
         password = Request.Cookies("NFuseData")("NFuse_Password")
    Else
         user = app.HTMLEncode(Request.Form("user"))
         domain = app.HTMLEncode(Request.Form("domain"))
         password = app.HTMLEncode(Request.Form("password"))
         response.Write(user&"<br>"&password&"-->from form")
         If (user = "") Then
              response.Write("Problem Occured ")
              response.end
         Else
              Response.Cookies("NFuseData")("NFuse_User") = user
              Response.Cookies("NFuseData")("NFuse_Domain") = domain
              Response.Cookies("NFuseData")("NFuse_Password") = password
                        End If
    End If

Fritz the Blank
0
 
aaviAuthor Commented:
my app object does not support this kind of metod
0
 
aaviAuthor Commented:
thank you very much "fritz_the_blank"
you've realy helped me ALOT
its good to have people like you around
thanks,
Avi Algaly
0
 
fritz_the_blankCommented:
I am glad to have helped. I am sorry for the messed up earlier posts--I am working on too many things at once this morning and am making stupid mistakes.


Good luck with your project,

Fritz the Blank
0
All Courses

From novice to tech pro — start learning today.