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

后端 未结 3 1423
情话喂你
情话喂你 2021-01-03 02:09

I have the session timeout set to 20min but when I try to access this value from action I\'m getting 1min instead.

Web.Config setti

3条回答
  •  伪装坚强ぢ
    2021-01-03 02:31

    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.

提交回复
热议问题