NishantTyagi-7000 avatar image
0 Votes"
NishantTyagi-7000 asked AlbertKallal-4360 commented

ASP.NET session has expired or could not be found while running RDL reports


We are using Report Viewer control in aspx page to show RDLs in our application . Only one server was in rotation , all was good.

Now we have added one more leg(server) in rotation to improve website to handle no. of request .

But after adding new server we are getting Errror "ASP.NET session has expired or could not be found" after F5 sometime it works , some time not

  1. eGlassReportViewer.AsyncRendering as false

  2. eGlassReportViewer.KeepSessionAlive as true

We have made Session state as out proc with state Server also but still getting same error .

Please suggest what we are missing here

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @NishantTyagi-7000,
You can set the KeepSessionAlive property of reportviewer to true.Alternatively, you can use heartbeat to keep the session alive.You can click this link to see a more detailed explanation.

0 Votes 0 ·

If you have more then one server involved for load balancing?

You have to simply turn on and adopt sql sessions and use SQL server based sessions(). You don't have to change your code, but you will have to create the session table and turn this feature on. once done, then your session() state will now automatic be saved to sql server.

Since more then one server is involved, then "in memory" session() can't be used - since there is no provisions for transferring "memory" from one server to the other. You also as a general rule have to adopt and turn on SQL server session() management when using Azure (cloud based) web hosting - the reason again is that you don't know, and can't even control what server that web page will eventually be spooled up on, and even a individual post back can run on one server, and the next post back can in theory be run on the OTHER server, or even another server.

0 Votes 0 ·

I'm getting this message as well, but in our case, we're using a custom session provider to handle session for our webservers. Is SQL Server session management the only session-state option that the ASP.NET WebViewer control will work with?

0 Votes 0 ·

Well, if you using some type of server farm, then sql based sessions would be the only way that sessions() will work. You can't use say in-memory, since one web page request might be handled by one server, and the next page request would be handled by another. So unless a single shared session() system is being used, then session() can't be shared between two servers.
So, this has as far as I can tell ZERO to do with reporting services and everything to do with that your session() system has to be in working order.

So, if your session() management system works correctly across servers, then it should work fine.

So, I can't say that the report viewer system will care or even know what kind of session() system you have, but that session() system has to seamless work, and work between requests that can and will occur between the two servers - and thus a common session system is the requirement, more so then the report viewer even knowing or caring how session() works.

I don't know of any other solutions that share + allow session() between different services. However, if you do have such a system, then code or report viewers should not care or even know about that session system, but only that it works correctly with

0 Votes 0 ·

1 Answer

Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered

You also need to set matching machine keys (or shared key storage if using data protection) for the session and authentication cookies to work in a web farm.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.