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的更多相关文章

  1. 设置aspx页面的地址栏中的Session ID的显示与隐藏

    设置aspx页面的地址栏中的Session ID的显示与隐藏修改web.config文件中的sessionState节点下的cookieless的值 1.cookieless的值是false的时候隐藏 ...

  2. ORA-00030: User session ID does not exist.

    同事在Toad里面执行SQL语句时,突然无线网络中断了,让我检查一下具体情况,如下所示(有些信息,用xxx替换,因为是在处理那些历史归档数据,使用的一个特殊用户,所以可以用下面SQL找到对应的会话信息 ...

  3. 【转】Session ID/session token 及和cookie区别

    Session + Cookie  知识收集! cookie机制采用的是在客户端保持状态的方案.它是在用户端的会话状态的存贮机制,他需要用户打开客户端的cookie支持.cookie的作用就是为了解决 ...

  4. Session id实现通过Cookie来传输方法及代码参考

    1. Web中的Session指的就是用户在浏览某个网站时,从进入网站到浏览器关闭所经过的这段时间,也就是用户浏览这个网站所花费的时间.因此从上述的定义中我们可以看到,Session实际上是一个特定的 ...

  5. [Javascript] Intro to Recursion - Detecting an Infinite Loop

    When using recursion, you must be mindful of the dreaded infinite loop. Using the recursive function ...

  6. 获得创建临时表的session id

    通过sql server的default trace和tempdb中的sys.objects视图,你能够获得创建临时表的session id,下面是相应的sql语句: DECLARE @FileNam ...

  7. 【从翻译mos文章】正在实施的获取job的 session id

    正在实施的获取job的 session id 参考原始: How to get the session Id of the Running Job (Doc ID 1604966.1) 申请: Ora ...

  8. [解决]Linux Tomcat启动慢--Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [236,325] milliseconds

    一.背景 今天部署项目到tomcat,执行./startup.sh命令之后,访问项目迟迟加载不出来,查看日志又没报错(其实是我粗心了,当时tomcat日志还没打印完),一开始怀疑是阿里云主机出现问题, ...

  9. 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 ...

随机推荐

  1. bzoj 3438: 小M的作物

    Description 背景 小M还是个特么喜欢玩MC的孩纸... 描述 小M在MC里开辟了两块巨大的耕地A和B(你可以认为容量是无穷),现在,小P有n中作物的种子,每种作物的种子有1个(就是可以种一 ...

  2. poj1664-放苹果(递归)

    一,题意: M个苹果放在N个盘子里,允许有盘子空着,问共有多少种不同的分法. 二,思路: 递归的思想求解: 1,有反复执行的过程(调用本身) 第一种情况n>m : 必定有 n-m 个盘子空着,去 ...

  3. NDK中可靠的获取JNIEnv*的方法

    使用NDK时,几乎任何方法都需要一个JNIEnv来调用.这个类是和线程相关的,如何可靠的获取它? 首先,作为NDK的so,必然有一个地方是由android系统调用的,这个调用将带来一个JNIEnv参数 ...

  4. 前端Javascript书籍分享

    早前在公司曾做过一些关于前端的技术分享,而每每跟大家谈到深处时,大家会疑惑这些知识点从何而来. 我会经常在内部去推荐自己读过的好书,希望大家在技术层面上都能更上一个台阶. 今天写下这个帖子一方面是记录 ...

  5. js获取上传文件个数 以及名称

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. "undefined method `root' for nil:NilClass" error when using "pod install" 解决办法

    如果pod undate 的时候报错"undefined method `root' for nil:NilClass" error when using "pod in ...

  7. 理解AX InventTrans的几种状态

    接触AX一段时间后,发现InventTrans表非常重要.它可以说是物流模块的核心,开发BI报表的话必须依赖此报表.   先来看官方释义: InventTrans表包含了库存交易的信息.当销售/采购订 ...

  8. EntityFramework优缺点

    高层视图: 改变在现有系统使用EntityFramework的优势是什么? • All -in-1框架的类映射表,需要编写映射代码, 并且是很难维护的. • 可维护性,易于理解的代码,无需创造大的数据 ...

  9. mysql主键uuid、uuid_short和int自增对比

    数据库主键性能对比: 名称 存储长度 生成方式 1. uuid 32+4 uuid()函数 2. uuid20 20 UUID_SHORT()函数 3. bigint自增 20 auto_increm ...

  10. nvm诡异的报错

    安装:curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash wget -qO- htt ...