protected void Btnlogout_Click(object sender, EventArgs e) { if (Request.Cookies["TeacherCookies"] != null) { int Rhid = Int32.Parse(Request.Cookies["TeacherCookies"].Values["Hid"].ToString()); LearnSite.BLL.Room bll = new LearnSite.BLL.Room(); bll.UnlineClass(Rhid);//将所教的当前上课班级变为不上课 LearnSite.Common.CookieHelp.ClearTeacherCookies(); LearnSite.Common.CookieHelp.ClearStudentCookies();//教师退出的话把本机学生平台也退出 Session.Abandon();//取消当前会话 Session.Clear();//清除当前浏览器进程所有session } System.Threading.Thread.Sleep(200); Response.Redirect("~/Teacher/index.aspx", false); }
protected void Btnlogout_Click(object sender, EventArgs e) { if (Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname] != null) { int Rhid = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname].Values["Hid"].ToString()); LearnSite.BLL.Room bll = new LearnSite.BLL.Room(); bll.UnlineClass(Rhid); //将所教的当前上课班级变为不上课 LearnSite.Common.CookieHelp.ClearTeacherCookies(); LearnSite.Common.CookieHelp.ClearStudentCookies(); //教师退出的话把本机模拟学生角色登录的学生平台也退出 LearnSite.Common.App.AppUserMatchRemove("s" + Rhid.ToString()); //教师退出时移除全局变量中模拟学生 LearnSite.Common.App.CurrentClassRemove(Rhid); //教师退出时移除全局变量中当前上课班级的学生 Session.Abandon(); //取消当前会话 Session.RemoveAll(); Session.Clear(); //清除当前浏览器进程所有session LearnSite.Common.Others.ClearClientPageCache(); System.Threading.Thread.Sleep(300); string rurl = "~/Teacher/index.aspx?qt=" + DateTime.Now.Millisecond.ToString(); Response.Redirect(rurl, false); } }