By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,594 Members | 3,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,594 IT Pros & Developers. It's quick & easy.

Cookies special characters.

P: n/a
Is it possible to write special html characters in a cookie? I'm
having difficulties reading these characters back out of the cookie:
the string representation is garbled. Strings with special chars are
rendered fine on my local machine but not with remote US server.

Using ISO 8859-1 characters codes such as é or é yield no
improvement. I've also tried UTF8 encoding to no avail as shown below.
TIA for any hints.

Read/write cookie functions (simplified) :

Private Sub ReadCookie()
...
Request.ContentEncoding = System.Text.Encoding.UTF8
Dim strCk As String = CStr(Request.Cookies(cok)(cpageName))
...
End Sub

Private Sub WriteCookie()
...
Dim strCk As String = String.Format("{0}", Me.hdr.InnerHtml)
Response.ContentEncoding = Encoding.UTF8
...
End Sub
Oct 20 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
After some experimenting, it seems that Server.UrlEncode and
Server.UrlDecode do the trick.
Oct 21 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.