ASP.NET session has expired or could not be found -> Because the Session.SessionID changes (Reporting Services)

三世轮回 提交于 2019-11-30 13:44:37

You are probably storing your session InProcess. Try changing it to session state server. You can find more details here.

I'm using report viewer 11.0.0; in your web config on system.web section, put the next configuration:

<sessionState timeout ="120" mode="InProc" cookieless="false" />

When you are generating the report (C# code bellow) in the reportviewer object change the KeepSessionAlive property to false and the AsynkRendering property to false, and that's all

        this.rvReporte.KeepSessionAlive = false;
        this.rvReporte.AsyncRendering = false;

(rvReporte) is a ReportViewer control located on my asp.net Form This solution work for me, i hope that work for other people.

Regards

<httpCookies httpOnlyCookies="false" requireSSL="false"/>

Solved the problem. Thanks to : http://www.c-sharpcorner.com/Blogs/8786/reportviewer-Asp-Net-session-has-expired.aspx

I solved this issue by setting AsyncRendering to false on reportviewer server control

The answer given by Alexsandar is just one of the solution to this problem.

This link clearly explains what is the root cause for this problem and possible solutions: http://blogs.msdn.com/b/brianhartman/archive/2009/02/15/did-your-session-really-expire.aspx

In case of Brian, the way he has descrived the problem, if he had just a single IIS server, using a session object in his code would have solved the problem because in that case, the SessionID which is passed in the request from browser to the server will get mapped to a corresponding sessionID on the server and hence the session expiry message will not come.

Setting the mode may only work in case of a server cluster where Brian had multiple IIS servers handling the same request. In that case an out of process mode will help to retrieve the session object from the Session Store irrespective of the server hit.

So based on this observation, I would conclude that Brian's problem was not related to cookies but to a server cluster. The information provided by Brian in his question and the subsequent solution misled me and hence this clarification. Hope it helps anyone looking for a similar problem.

Thanks, Vipul

I had the same issue on report viewer page when the web site was accessed from outside intranet. hardvin's suggestion saved the day for me which is to set this.rvReporte.KeepSessionAlive = false; this.rvReporte.AsyncRendering = false;

I changed the property on the control itself. I am using report viewer on a user control which raises a custom event for supplying parameters programmatically at the host page instead of prompting the users.

Try removing SessionState="somevalue" tag from the top of your calling ASPX page. I'm using a custom SessionState and refuse to use InProc since I have multiple instances on Azure. You can even use AsyncRendering=True if you desire. Let me know if this did the trick for you.

For me, it turned out to be having more than one worker process for the app pool.

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