Cookies change the character code?

Discussion in 'ASP General' started by victor, Jun 29, 2003.

  1. victor

    victor Guest

    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=request.form("username")
    response.cookies("username")=username
    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>
     
    victor, Jun 29, 2003
    #1
    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. Alex Nitulescu

    Response.Cookies vs Request.Cookies

    Alex Nitulescu, Feb 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    8,514
    Hans Kesting
    Feb 3, 2005
  2. Velvet
    Replies:
    9
    Views:
    14,848
    Joerg Jooss
    Jan 19, 2006
  3. Andy Fish
    Replies:
    3
    Views:
    6,544
    Fredrik Lindner
    Nov 6, 2003
  4. _Who
    Replies:
    7
    Views:
    2,691
  5. John Gregory
    Replies:
    0
    Views:
    299
    John Gregory
    Jul 5, 2009
Loading...

Share This Page