ASP.NET session expired or could not be found & # 8594; Because the Session.SessionID (Reporting Services) parameter changes

1. -I use report services, and sometimes I get this error ASP.NET session has expired or could not be found when trying to load a report.

2. -I realized that I get this error when the Session.SessionID property changes, even if the user is the same. If it does not change, the report is downloaded. I mean, if I update the report several times, whenever Session.SessionID matches the last, the report is loaded.

3. Microsoft documentation says:

When using cookie-based session state, ASP.NET does not allocate storage for session data until the Session object is used. As a result, a new session identifier is created for each page request while accessing the session object. If your application requires a static session ID for the entire session, you can either implement the Session_Start Method in the File application and the Global.asax data store in the Session object to fix the session ID, or you can use the code in another part of your application to explicitly store data in the session object.

If your application uses cookieless session state, a Session ID is generated in the first page view and is maintained for the entire session.

The thing is, I cannot use cookieless session state because I need cookies.

What can I do to avoid this error? Or What can I do to avoid changing the Session.SessionID parameter for each request?

+7
source share
8 answers

You are probably saving your InProcess session. Try changing it to the session state server. You can find more information here .

+5
source

I am using the report viewer 11.0.0; in your web configuration under system.web, put the following configuration:

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

When you generate the report (C # code below) 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 works for me, I hope that work for other people.

Yours faithfully

+3
source
 <httpCookies httpOnlyCookies="false" requireSSL="false"/> 

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

+2
source

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

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

In the case of Brian, as he described the problem, if he had only one IIS server, using a session object in his code could solve the problem, because in this case the SessionID that is transmitted in the request from the browser to the server will be mapped to the corresponding sessionID on the server and, therefore, a message about the expiration of the session does not appear.

The mode setting can only work in the case of a server cluster where Brian had several IIS servers processing the same request. In this case, it will help to retrieve the session object from the session store from process mode, regardless of how it got into the server.

So, based on this observation, I would conclude that the Brian problem is not related to cookies, but to a cluster of servers. The information provided by Brian in his question and subsequent decision misled me and therefore this clarification. Hope this helps anyone looking for a similar issue.

Thanks, Vipul

+1
source

I had the same problem on the report viewing page when the website was accessed from outside the intranet. the offer of cruel salvation saved me for this, this.rvReporte.KeepSessionAlive = false; this.rvReporte.AsyncRendering = false;

I changed the property on the control itself. I use a report viewer in a user control that creates a custom event for programmatically passing parameters on the main page instead of asking users.

+1
source

I solved this problem by setting AsyncRendering to false on the Reportviewer management server

+1
source

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

0
source

For me, it turned out that there were several workflows for the application pool.

0
source

All Articles