Session variables lost after the call of Response.Redirect method
From: https://forums.asp.net/t/2096848.aspx?Session+variables+lost+after+the+call+of+Response+Redirect+method
[问题]
Hi Everyone,
In my asp.net application after I login, my session variables, which I set in login page, are getting lost after the call to Response.Redirect method.
After googling I found the below link elaborate the cause of the problem.
I really couldn't get the solution suggested in the above link.
I didn't get the error or the issue was not there for a month. It suddenly appeared yesterday and I'm unable to use my session variables if use Response.Redirect method, even with the second argument with 'false', ie. Response.Redirect(URL,false);
Why I got the error all of a sudden? And what is the solution?
[回答]
Hi ArunCode47,
Have you tried setting cookieless="true" in web.config? Check that enableSessionState hasn't been set to false in the web.config.
<configuration>
<system.web>
<pages enableSessionState="true">
<sessionState
cookieless="true"
regenerateExpiredSessionId="true"
timeout="30" />
</system.web>
</configuration>
ASP.NET Session State Overview
Best Regards,
Chris
Session variables lost after the call of Response.Redirect method的更多相关文章
- aspx在页面跳转(Response.Redirect)时丢失session问题及解决办法
[问题描述] 假设a.aspx.cs页面保存有Session["empid"]="3",当a.aspx.cs通过Response.Redirect(" ...
- Response.Redirect("x.aspx);跳转后session为null的解决方法
通常我们做登陆的时候都是登录成功后为管理员保存一些信息,一般都会写类似下面的代码 if(登录成功) { Session["xx"] = "user"; Resp ...
- ASP.NET Response.Redirect 丢失 Session的问题(作废,仅供参考)
以前在做ASP.NET开发时一直没注意到一个问题,就是广泛使用的Response.Redirect方法并不会将服务器端在Response中新增或修改的Cookie返回给客户端浏览器,而网站的Sessi ...
- 关于session variables 和 global variables
背景 有同学问到这样一个问题:原来的binlog格式是statement,为什么执行了 set global binlog_format='row' 和 set binlog_format='row' ...
- Response.Redirect()、Server.Execute和Server.Transfer的区别
1.Response.Redirect(): Response.Redirect方法导致浏览器链接到一个指定的URL. 当Response.Redirect()方法被调用时,它会创建一个应答,应答头中 ...
- 1. Server.Transfer和Response.Redirect
今天在使用ServerTransfer和Response.Redirect定位到当前页面来实现刷新页面时,发现了一些现象: 1.使用Response.Redirect刷新本页面,造成当前页面显示的数据 ...
- 页面跳转 Server.Transfer和 Response.Redirect的区别
1.Server.Transfer 用于把处理的控制权从一个页面转移到另一个页面,在转移的工程中没有离开服务器内部控件(如request,session等)保存的信息不变.因此你能从a页面跳转到b页面 ...
- Response.Redirect(),Server.Transfer(),Server.Execute()的区别与网站优化
转 http://blog.csdn.net/dannywj1371/article/details/10213631 1.Response.Redirect():Response.Redirect方 ...
- c#页面重定向,Server.Transfer 和 Response.Redirect
Server.Transfer() 重定向发生在服务器端,把处理的控制权从当前页面转移到另一个页面,在转移的工程中没有离开服务器内部控件(如request,session等)保存的信息不变. 1.只能 ...
随机推荐
- AtCoder Grand Contest 026 (AGC026) E - Synchronized Subsequence 贪心 动态规划
原文链接https://www.cnblogs.com/zhouzhendong/p/AGC026E.html 题目传送门 - AGC026E 题意 给定一个长度为 $2n$ 的字符串,包含 $n$ ...
- 20165235实验四 Android程序设计
20165235实验四 Android程序设计 实验课程:JAVA编程设计 实验名称:Android开发 姓名:祁瑛 学号:20165235 实验时间:2018.05.16 指导老师:娄家鹏 Andr ...
- JavaScript深拷贝实现原理简析
原文:http://www.cnblogs.com/xie-zhan/p/6020954.html JavaScript实现继承的时候,需要进行对象的拷贝:而为了不影响拷贝后的数据对原数据造成影响,也 ...
- 2501 矩阵距离 (bfs)
描述 给定一个N行M列的01矩阵 A,A[i][j] 与 A[k][l] 之间的曼哈顿距离定义为: dist(A[i][j],A[k][l])=|i-k|+|j-l| 输出一个N行M列的整数矩阵B,其 ...
- HDU-2177 取(2堆)石子游戏 (威佐夫博奕)
Problem Description 有两堆石子,数量任意,可以不同.游戏开始由两个人轮流取石子.游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子:二是可以在两堆中同时取走相同 ...
- 【未解决】Linux下PHP安装扩展Mysql的问题
[步骤分析] 1.在PHP源码包下定位到指定位置:源码包/ext/mysqli 注1:网上很多地方红字部分是mysql,其实PHP5以后已经不用mysql了. 2.运行:/usr/local/php/ ...
- BZOJ-1- 4868: [Shoi2017]期末考试-三分
三分出成绩时间,假设当前出成绩最优,那么提前就会调增老师,增加不愉快度多于少等待的:如果延迟时间. 那么等待更久,增加的不愉快度也将多余少调增剩省下的. 于是:对于当前点,两边都是有单调性的. 就是说 ...
- asp.net结合html使用
在用asp.net开发系统时,用控件能更方便快捷,但是大家也知道用它的控件会导致不可控,特别是css,如何用前端定义的html+css+js来运用asp.net(c#)呢,下面写了一个小实例,实现页面 ...
- 【PYTHON】 Missing parentheses in call to 'print'
Microsoft Windows [版本 10.0.15063] (c) 2017 Microsoft Corporation.保留所有权利. C:\Users\Jam>python Pyth ...
- Python print函数用法,print 格式化输出
原文地址:http://blog.csdn.net/zanfeng/article/details/52164124 使用print输出各型的 字符串 整数 浮点数 出度及精度控制 strHello ...