Cookies change the character code?

V

victor

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top