locked
ASP.NET MVC session timeout around 60 seconds in Chrome and FireFox RRS feed

  • Question

  • User-711744347 posted

    I'm having a weird issue where if a user sits on the page for around 60 seconds, the url parameters aren't carried over to the next page and user gets the error page since controller thinks no parameters were passed. This happens only in Chrome and FireFox. Works fine in IE. There is one 404 in chrome for mixed content. I'm unable to replicate this issue in test. I didn't set set the session timeout in web.config so I believe it's the default of 20 minutes. Also, the asp.net Session cookie isn't lost, i can see it even when I get the error page.

    Any ideas?

    Wednesday, February 5, 2020 9:28 PM

All replies

  • User475983607 posted

    URL parameters are by definition in the URL and usually static text within the page markup.   It's not real clear what "the url parameters aren't carried over to the next page" means. Are you clicking a link?  Submitting a form?  Can you provide sample code that reproduces this issue?

    Wednesday, February 5, 2020 9:56 PM
  • User-711744347 posted

    It's a url with some parameters. E.g. example.com/?name='john'&guid='shhshs' . When somebody clicks on this link which is embedded in a form (on some other website) with method type as "GET", it takes them to an application where these parameters are read and it displays some information and images based on the parameters and then you can click another button on this page, which is set to 'POST' that takes you to another page. However, if you sit on the middle page for around 60 seconds in Chrome and Firefox and then click the button, it displays the error page since original parameters are lost and they are needed for it to display proper form and values. It works if clicked in less than 60 seconds.

    I wonder if this has something to do with the way Chrome handles Get requests or perhaps the mixed content 404? Both Chrome and Firefox also seem  to be caching content, while IE 11 seems to make a new request on each click.

    I did found this "Some browsers, however, will discard any explicit parameters passed in a query string if a form is submitted with the GET method." here https://docs.microsoft.com/en-us/previous-versions/iis/6.0-sdk/ms525506(v%3Dvs.90)

    Wednesday, February 5, 2020 10:05 PM
  • User475983607 posted

    Browsers do not arbitrarily discard parameters in a URL or an HTML Form.  If these parameters are actually persisted in Session and you are losing Session that usually indicates an issue with the application restarting or your application is load balanced.

    Again, share code that causes this issue so we can see how your application works rather than guessing from a description.

    Wednesday, February 5, 2020 11:55 PM