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 ...
随机推荐
- linux系统安装(上)
1.VMware虚拟机的软件应用 www.vmware.com 2.linux系统安装设置(分区为重点) 3.远程登录管理工具介绍centOS5.5 使用虚拟机的优点 1.不用分区 2.可以完成本机与 ...
- 安卓中級教程(7):annotation中的 public @interface的用法
package com.example.ele_me.util; import java.lang.annotation.Retention; import java.lang.annotation. ...
- C++ I/O stream
C++ I/O stream Ø The first, you should understand following: ... Ø Text: Ø Version: Visual studio 20 ...
- 被swoole坑哭的PHP程序员
被swoole坑哭的PHP程序员 2015-09-16 09:57 文帅营 博客园 字号:T | T 首先说一下对swoole的理解:披着PHP外衣的C程序.很多PHPer朋友看到swoole提供的强 ...
- Blog 公用部分结构与class定义
/*博客文章公用部分class与结构 common*/ /* 1.title-block //标题块 ├── border-danger //危险红 ├── border-info //普通蓝 └── ...
- Netty In Action
1 introduction 1.2 Asynchronous by design two most common ways to work with or implement an asynchro ...
- scala的面向对象编程
1.scala的简单编程 2.构造方法 辅助构造函数是在主构造函数没有的情况下,执行的构造函数. 3.object的介绍 4.半生类和半生对象 5.半生的案例程序(半生类可以调用半生) 6.apply ...
- C#常用控件介绍
目录 1.窗体(Form) 2.Label (标签)控件 3.TextBox(文本框)控件 4.RichTe ...
- 基于ssh框架开发的购物系统的质量属性
根据前面的博客,我们已经大致了解了ssh架构开发整体概念:Struts是一个实现了MVC模式的经典的框架:Hibernate是轻量级Java EE应用的持久层解决方案,以面向对象的方式提供了持久化类到 ...
- WordPress基础:自定义菜单
需要自定义一个菜单,可以访问后台->外观->菜单