Cookies change the character code?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • victor

    Cookies change the character code?

    Hi,

    I used Cookies to store username.

    In a Windows98 client, I typed some Chinese characters into the login
    box in login.asp. After submit, in c.asp, the username is stored in
    the cookies. The original username and the one got back from the
    cookies are displied in c.asp, they are different! Use WindowsXP
    client will be fine.

    Can you help?

    login.asp, login username:
    <%@codepage=936 %>
    <html>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" >
    <form action="c.asp" method="post">
    <input name="username" ><input type="submit">
    </form>
    </html>

    c.asp, display the usernames:
    <%@codepage=936 %>
    <%
    username=reques t.form("usernam e")
    response.cookie s("username")=u sername
    response.write( username & "<br>") 'these two usernames are not the
    same!
    response.write( request.cookies ("username") )
    %>
    <html>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" >
    </html>
Working...