Forum Discussion

Yannie's avatar
Yannie
Copper Contributor
Jan 19, 2022

MS Teams Application HTTP Context Session Changed when Postback

I have a MS Teams App that contains tab for opening SharePoint Add-ins (Provider-hosted) pages.

When using MS Teams Desktop and web, the session always changes when Postback and failed to get SharePoint Context.

httpContext.Session.SessionID: jlsla5ggvdr2dbcpxivqxa5t

After clicking the button for Postback

httpContext.Session.SessionID: nau5tyvs1rjbqrqvvqtx2cll

This only happens in using MS Teams Desktop and Web for some users.

 

Will there be a way stop refreshing the Http Context Session when Postback?

27 Replies

  • Yannie - Could you please share more details on this issue? Also please share sample and repro steps, so that we can check it locally.
    • Yannie's avatar
      Yannie
      Copper Contributor

       We have a Provider-hosted SharePoint Add-in with several pages.

      We put them on a MS Teams App as a tab by using App Studio.
      The pages works well at first on MS Teams Desktop but recently users report that the issue persist while using Teams Desktop. 
      After adding some debugging logs to the add-in, we found that the page session is null after postback and result in the application failed to get the SharePoint Context only when using MS Teams web and Desktop.

       

      To replicate,

      create a provider-hosted add-in and install to a SharePoint site

      create a blank page with a button that will trigger postback in the add-in.

      create the Teams app using App Studio and add the page as Tab.

      Test and install the app

      Open the tab and click the button using MS Teams web

       

      Meghana-MSFT

Resources