Infinite loop when using cookieless session ID on Azure
If you use cookieless session ID and deploy them on Azure, you might get infinite loop when you query your web site, and browser would down. In this scenario, you need to overwrite ASP.NET default ISessionIDManager.
In method GetSessionID, your could should be below
public string GetSessionID(HttpContext context)
{
var id = HttpContext.Current.Items["AspCookielessSession"] as string;
// Azure web site does not support header "AspFilterSessionId", so we cannot get context.Items["AspCookielessSession"]
// for azure web site use, Headers["X-Original-URL"] format: /(S(xxx))/default.aspx
var originalUrl = HttpContext.Current.Request.Headers["X-Original-URL"];
if (!string.IsNullOrEmpty(originalUrl))
{
var match = Regex.Match(HttpContext.Current.Request.Headers["X-Original-URL"], @"/\(S\((\w+)\)\)");
if (match.Success)
{
id = match.Groups[].Value;
}
} return id;
}
Don't forget to change your web.config file.
Infinite loop when using cookieless session ID on Azure的更多相关文章
- 设置aspx页面的地址栏中的Session ID的显示与隐藏
设置aspx页面的地址栏中的Session ID的显示与隐藏修改web.config文件中的sessionState节点下的cookieless的值 1.cookieless的值是false的时候隐藏 ...
- ORA-00030: User session ID does not exist.
同事在Toad里面执行SQL语句时,突然无线网络中断了,让我检查一下具体情况,如下所示(有些信息,用xxx替换,因为是在处理那些历史归档数据,使用的一个特殊用户,所以可以用下面SQL找到对应的会话信息 ...
- 【转】Session ID/session token 及和cookie区别
Session + Cookie 知识收集! cookie机制采用的是在客户端保持状态的方案.它是在用户端的会话状态的存贮机制,他需要用户打开客户端的cookie支持.cookie的作用就是为了解决 ...
- Session id实现通过Cookie来传输方法及代码参考
1. Web中的Session指的就是用户在浏览某个网站时,从进入网站到浏览器关闭所经过的这段时间,也就是用户浏览这个网站所花费的时间.因此从上述的定义中我们可以看到,Session实际上是一个特定的 ...
- [Javascript] Intro to Recursion - Detecting an Infinite Loop
When using recursion, you must be mindful of the dreaded infinite loop. Using the recursive function ...
- 获得创建临时表的session id
通过sql server的default trace和tempdb中的sys.objects视图,你能够获得创建临时表的session id,下面是相应的sql语句: DECLARE @FileNam ...
- 【从翻译mos文章】正在实施的获取job的 session id
正在实施的获取job的 session id 参考原始: How to get the session Id of the Running Job (Doc ID 1604966.1) 申请: Ora ...
- [解决]Linux Tomcat启动慢--Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [236,325] milliseconds
一.背景 今天部署项目到tomcat,执行./startup.sh命令之后,访问项目迟迟加载不出来,查看日志又没报错(其实是我粗心了,当时tomcat日志还没打印完),一开始怀疑是阿里云主机出现问题, ...
- Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [33,755] milliseconds.
刚部署好程序,第一次登录时,加载非常得慢,查看log日志发现:Creation of SecureRandom instance for session ID generation using [SH ...
随机推荐
- Junit测试 - Spring的配置
第一种: @ContextConfiguration(locations = {"classpath*:/spring-core.xml"}) public class UserM ...
- Struts2中的ModelDriven机制及其运用
所谓ModelDriven,意思是直接把实体类当成页面数据的收集对象.比如,有实体类User如下: package cn.com.leadfar.struts2.actions; public cla ...
- hibernate 异常:Unexpected Exception caught setting
异常信息:Unexpected Exception caught setting 'outHeight' on 'class com.srpm.core.project.seismicFortific ...
- swift-UserDefaults控制账号和密码
import UIKit class FiveVC: UIViewController { //MARK:-------- 全局 常量 设置 let IsFirstLaunch = "IsF ...
- Nginx中FastCGI配置优化
FastCGI: FastCGI是从CGI发展改进而来的.传统CGI接口方式的主要缺点是性能很差,因为每次HTTP服务器遇到动态程序时都需要重新启动脚本解析器来执行解析,然后结果被返回给HTTP服务器 ...
- MXNET安装过程中遇到libinfo导入不了的问题解决
今天尝试安装windows版本的MXNET,在按照官网的运行了python的setup之后,import mxnet时出现如下错误:cannot import name libinfo,在网上查找发现 ...
- mui框架使用的过程中遇到的几个问题
1.zepto.js和mui一起使用的时候,tap事件会发生两次,这时只要不引用zepto.js的touch.js就可以了,只用mui的tap事件,如: mui(".infor_header ...
- docker好文收藏
深入浅出Docker(一):Docker核心技术预览 2. 核心技术预览 Docker核心是一个操作系统级虚拟化方法, 理解起来可能并不像VM那样直观.我们从虚拟化方法的四个方面:隔离性.可配额/可度 ...
- spring+mybatis 手动开启和提交事务
spring配置文件 事务控制管理器transactionManager <!-- (事务管理)transaction manager, use JtaTransactionManager fo ...
- marathon新建应用映射端口限制
映射端口范围不能使用:1~1024 (除 80 443), 5000~5100, 6000~6999, 10000~20000, 31000~32000 映射端口可能与 Chrome 冲突: 6665 ...