无法读取到Cookies 是没有存进去还是 我取值的时候错误了。请教大家。
登陆页面 代码 if (this.ddlstatus.SelectedValue == "普通用户")
{
if (BaseClass.CheckStudent(txtNum.Text.Trim(), txtPwd.Text.Trim()))
{
Session["ID"] = txtNum.Text.Trim();
Session["name"] = txtNum.Text.Trim();
Response.Cookies["UserloginName"].Value = txtNum.Text.Trim();//Cookies保存用户名目标页面或其他页面 if (!IsPostBack)
{
try
{ if (Response.Cookies["UserloginName"].Value != null)
{
//用户曾登录
Session["ID"] = Response.Cookies["UserloginName"].Value; //读取Cookie
Session["name"] = Response.Cookies["UserloginName"].Value; //读取Cookie
}
else
{
//返回登录登录界面
Response.Redirect("../Login.aspx");
}
登陆页面 代码 if (this.ddlstatus.SelectedValue == "普通用户")
{
if (BaseClass.CheckStudent(txtNum.Text.Trim(), txtPwd.Text.Trim()))
{
Session["ID"] = txtNum.Text.Trim();
Session["name"] = txtNum.Text.Trim();
Response.Cookies["UserloginName"].Value = txtNum.Text.Trim();//Cookies保存用户名目标页面或其他页面 if (!IsPostBack)
{
try
{ if (Response.Cookies["UserloginName"].Value != null)
{
//用户曾登录
Session["ID"] = Response.Cookies["UserloginName"].Value; //读取Cookie
Session["name"] = Response.Cookies["UserloginName"].Value; //读取Cookie
}
else
{
//返回登录登录界面
Response.Redirect("../Login.aspx");
}
呀,这个我倒没有看见, 好大的bug啊 哈哈哈