ASP.NET Session Timeout Issue with ReportViewer in an iframe

Shende1, Pankaj 0 Reputation points
2024-09-28T07:35:47.39+00:00

I'm using the following setup to load SSRS reports with the <rsweb:ReportViewer> control in an ASP.NET web application:

<rsweb:ReportViewer 
    id="RptViewer" 
    runat="server" 
    width="100%" 
    skinid="rv" 
    ProcessingMode="Remote" 
    ZoomMode="FullPage">
</rsweb:ReportViewer>

My web.config session settings are configured like this:

<system.web>
   <sessionState cookieless="UseCookies" mode="InProc" timeout="20" cookieSameSite="None" />
</system.web>

We're using .NET Framework 4.8 on a server in a web farm setup. When loading the ReportViewer via an iframe, we're encountering ASP.NET session timeout errors.

Could this issue be related to the ReportViewer's support for iframes? Do we need a custom HTTP handler to maintain the session across the iframe?

If anyone has faced a similar issue, your guidance would be greatly appreciated.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,504 questions
{count} votes

2 answers

Sort by: Most helpful
  1. SurferOnWww 3,041 Reputation points
    2024-09-28T11:07:43.2633333+00:00

    We're using .NET Framework 4.8 on a server in a web farm setup.

    Does your server provide sticky session? Please note that the ReportViewer uses the ASP.NET Session. Since your Session is InProc, web farm will have to provide sticky session.


  2. Lan Huang-MSFT 29,746 Reputation points Microsoft Vendor
    2024-09-30T08:48:43.14+00:00

    Hi @Shende1, Pankaj,

    If you're only having this issue in an iframe, you could try putting this in your web.config.

    <sessionState cookieSameSite="None" />
        <httpCookies requireSSL="true"/>
    

    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.