Losing session data in ASP.NET
2024-09-04 06:10:50
Losing session data in ASP.NET
By default Response.Redirect
terminates thread execution and there might be a race conditions in setting session variables. It is described in article Don't redirect after setting a Session variable (or do it right), so try to use another, less violent version:
Response.Redirect("cpanel.aspx", false);
如果需要troubleshooting的话,可以打印HttpContext.Current.Session.SessionID来验证
另外如果代码中,重置了session的话。也会导致session中的数据丢失
Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", string.Empty));
最新文章
- IIS安装时,添加/编辑应用程序扩展名映射 确定按钮不可用。
- oracle错误码
- Sorl之.net操作
- ASUS K751笔记本电脑使用U盘启动
- C#编程实现Excel文档中搜索文本
- 键盘事件与JS Filter
- C - Virtual Friends
- 结构-行为-样式-angularJs ngAnimate(Js实现)
- Codeforces 986D Perfect Encoding FFT 分治 高精度
- 在linux上安装tomcat
- AS 自定义 Gradle plugin 插件 案例 MD
- vue2.0跨域携带cookie和IE兼容
- Redis主从同步分析(转)
- onsubmit解惑
- ubuntu16.04编译安装mysql5.7
- linux shell 删除指定文件夹下面 名称不包含指定字符的文件
- sublime3下载安装及常用插件、浏览器预览设置
- Nginx + Tomcat7 + redis session一致性问题
- Hadoop实战:reduce端实现Join
- 【Matlab】调试基础
热门文章
- [HDU2294]Pendant
- Sqlachemy的警告SAWarning: The IN-predicate on ";sns_object.BIZ_ID"; was invoked with an empty sequence. This results in a contradiction, which nonetheless can be expensive to evaluate.
- SelfCert wcf中 生成x5.09证书的工具
- 如何理解c++迭代器(上)
- VB - 错误处理
- C++中一个类(非继承类)对象,所占内存空间大小
- 一些关于SEO优化的笔记
- python基础--冒泡排序
- go 发送http请求
- .net core swagger汉化