2
When a webview is used (cordova like framework), we keep getting "refresh page?", "session has expired, the page will be automatically refreshed in x seconds"
Problem reported by Vinay B R - 6/21/2019 at 5:46 AM
Resolved
When the document viewer is shown in webview or as a iframe pointing to valid document, we are getting the below error,

Refresh Page
Session has expired, the page will be automatically refreshed in x seconds

page keeps refreshing over an again after the second reaches 0.

Below solutions won't/don't work for us -

- document is embedded inline, hence cannot provide a link as specified as a solution

- HTTP sessions are already enabled and is not a load balanced.

cross domain/iframe security could be limiting the capability. however, could there be other solutions (x-frame-options etc.) would work? we could try the changes as we have control over changes on the server.

5 Replies

Reply to Thread
0
Cem Alacayir Replied
Employee Post
FYI,
With FileUltimate v7.8.1 and DocumentUltimate v5.8.1 (November 23, 2020 updates), this issue is fixed out of the box for both ASP.NET Core and ASP.NET Classic (no settings required):

  • Added: Cookieless session will be used when necessary to automatically fix session issues, i.e. when the browser
    does not allow cookies via browser settings or via iframe with a cross-domain URL.
    The cookieless session will be established via headers, form or querystring where possible.

    Added GleamTechWebConfiguration.AutoCookielessSessionEnabled property to control this feature (default value is true).
    You don't need to use GleamTechWebConfiguration.CookieSameSiteFixEnabled when this property is true.

  • Fixed: When <sessionState cookieless="true" /> was set in Web.config, the below error was being thrown:
    'Invalid method request: Method with name "" not found'

0
Ron Replied
I'm using FileUltimate in a similar manner. I've upgraded the version to 7.8.1, but it is still not working within the Cordova WebView. 

It seems to work properly when in browser or as a PWA, but not within the WebView. 

It did work within the WebView with the <sessionState cookieless="true" /> but that caused other issues so it needed to be removed. 

Any other suggestions? 


0
Cem Alacayir Replied
Employee Post
FileUltimate v7.8.1 tests cookie support in browser and if not supported, it automatically uses the cookieless mode.

However it seems in Cordova WebView, cookie support passes the test on the client-side although Cordova WebView does not send the cookie to the server. So I guess we will need to put a special check for Cordova WebView, i.e. always use cookieless mode in Cordova WebView. I will let you know.

It did work within the WebView with the <sessionState cookieless="true" /> but that caused other issues so it needed to be removed.  

ASP.NET's own cookieless session mode should work without problems with FileUltimate v7.8.1. What's the issue you had? Probably it's an issue with your own app and not FileUltimate?

References:
0
Cem Alacayir Replied
Employee Post
FYI, with FileUltimate v7.8.5 and DocumentUltimate v5.8.5, you can now force cookieless session mode in case detection fails:

  • Improved: Removed GleamTechWebConfiguration.AutoCookielessSessionEnabled property and added GleamTechWebConfiguration.CookielessSessionMode
    The default is CookielessSessionMode.Auto. Cookie support is detected on the browser via JS with CookielessSessionMode.Auto.
    In some cases (e.g. Cordova WebView), the detection may not be reliable, in that case you can use CookielessSessionMode.Always.

For  ASP.NET Core, in appsettings.json:

{
  "GleamTechWeb:CookielessSessionMode": "Always"
}


For ASP.NET Classic, in Web.config:

<appSettings>
  <add key="GleamTechWeb:CookielessSessionMode" value="Always"/>
</appSettings>

Or in code:
GleamTech.AspNet.GleamTechWebConfiguration.Current.CookielessSessionMode = CookielessSessionMode.Always;
0
Cem Alacayir Replied
Employee Post Marked As Resolution
Latest info regarding cookie/session handling is compiled here:

Reply to Thread