怎样将用户登陆数据写入COOKIES??
如题,我想在进行用户登陆的时候,将用户名(admin_name),还有对应用户名的真实姓名(mingcheng)写入COOKIES或是SESSION中,然后在其它页面中调用,下面是登陆界面index.asp的源码,请大家指点,谢谢。。。<!--#include file="inc/conn.asp"-->
<!--#include file="inc/copy.inc"-->
<% dim rndnum,verifycode
Randomize
Do While Len(rndnum)<4
num1=CStr(Chr((57-48)*rnd+48))
rndnum=rndnum&num1
loop
session("verifycode")=rndnum
%>
<%
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="select * from admin"
rs.open sql,conn,1,3
%>
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%rs("mingcheng")%></title>
<link href=../css/css.css rel=STYLESHEET type=text/css>
<link href="../css/css1.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE2 {font-size: 14px}
-->
</style>
</head>
<body bgcolor="#799AE1">
<br>
<br>
<br>
<br>
<table width="413" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#3333CC">
<tr>
<td height="29" align="center" background="images/topbg.gif"> <table width="95%" align="right" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="middle"><font color="#FFFFFF" size="2"><b><%rs("mingcheng")%></b></font></td>
<td width="8%" align="right"><img src="images/help.gif" align="middle" border="0" alt="帮助文档"> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="25" align="center"><b><img src="images/xpbg.gif" width="411" height="74"></b></td>
</tr>
<tr>
<td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#EEEAD6"> <form action="inc/check.asp?action=login" method="POST">
<table width="95%" border="0" align="center">
<tr>
<td> <fieldset>
<legend accesskey="F" align="left"><font size="2">登陆窗口</font></legend>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="10%"><font size="2"> </font></td>
<td width="20%"><font size="2">用 户 名:</font></td>
<td><select name="admin_name" id="admin_name">
<%
set rs_name=server.createobject("adodb.recordset")
sql="select * from admin order by admin_name"
rs_name.open sql,conn,1,1
while not rs_name.eof
%>
<option value="<%=rs_name("admin_Name")%>"><%=rs_name("admin_Name")%> 实名:<%=trim(rs_name("mingcheng"))%></option>
<%
rs_name.movenext
wend
rs_name.close
set rs_name=nothing
%>
</select>
</td>
</tr>
<tr>
<td width="10%"><font size="2"> </font></td>
<td width="20%"><font size="2">密 码:</font></td>
<td><input name="admin_pass" type="password" id="admin_pass2" style="border-style:solid;border-width:1;padding-left:4;padding-right:4;padding-top:1;padding-bottom:1" onFocus="this.select(); " onMouseOver="this.style.background='#E1F4EE';" onMouseOut="this.style.background='#FFFFFF'" size="25">
</td>
</tr>
<tr>
<td align="center"> </td>
<td><font size="2">验 证 码:</font></td>
<td><input name="verifycode" id="verifycode" style="border-style:solid;border-width:1;padding-left:4;padding-right:4;padding-top:1;padding-bottom:1" onFocus="this.select(); " onMouseOver="this.style.background='#E1F4EE';" onMouseOut="this.style.background='#FFFFFF'" size="6" maxlength="4">
<font color="#000000" size="2">请在左边输入 <%=session("verifycode")%>
<input type="hidden" name="verifycode2" value="<%=session("verifycode")%>">
</font> </font></td>
</tr>
<tr>
<td colspan="2" align="center"> </td>
<td> <input name="submit" type="submit" class="input" value=" 登 陆 ">
<input type="reset" name="submit2" value=" 重 填 " class="input"></td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
<div align="center"><span class="STYLE2"><a href="../user/login.asp"><br>
点此进入新用户注册界面!</a></span></div>
</form></td>
</tr>
</table></td>
</tr>
</table>