Sitecore 7.5 MVC and HttpContext.Session.Timeout set to 1 min

梦想的初衷 提交于 2019-11-30 14:49:37

Every first request for a new user is considered as a possible bot request. That's why session timeout is set to 1 minute for those requests.

If the request is executed by the proper end user, there should be VisitorIdentification code on your page which in fact will cause another background call to the server and extend the session for the user.

Just add

@using Sitecore.Mvc.Analytics.Extensions
...
@Html.Sitecore().VisitorIdentification()

to your layout .cshtml file.

Timeout will be set to 1 minute for the first request, but then automatically changed back to 20 (or whatever is configured), when Sitecore does the VisitorIdentification call.

Piotr W

The problem is in robots detection in Sitecore Analytics module. My browser is recognized as a bot and there are some settings about that in Sitecore.Analytics.Tracking.config file:

 <!--  ANALYTICS ROBOTS SESSION TIMEOUT
        The ASP.NET Session Timeout for auto detected robots. 
        When the automatic robot detection identifies a session as being a robot, the ASP.NET
        Session Timeout is set to this value (in minutes).
        Default: 1
  -->
  <setting name="Analytics.Robots.SessionTimeout" value="1" />

The timeout is set to 1min when bot is detected to save some mememory and not to keep session too long.

The timeout will be set to desired 20min value when I either disable Analytics at all or disable Analytics.AutoDetectBots (in Sitecore.Analytics.Tracking.config file).

The proper solution for this is to clasify browser correctly (not as a bot).

Another post on this issue:

Sitecore Analytics Robots SessionTimeout causing premature session timeout

Ian Graham

In Sitecore 7 there is now multiple places you have to specify the Session Timeout.

I would check these values in your Web.config.

<setting name="Authentication.ClientSessionTimeout" value="120" /> 

and

<forms name=".ASPXAUTH" cookieless="UseCookies" timeout="120" />

and then

<sessionState mode="InProc" ... timeout="120" />

More info here:

Strange Timeout in Sitecore 7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!