Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chrome keeps session variables after browser close

I am using asp.net forms version 4 and using the built in FormsAuthentication. I have selected to not persist the User.

      FormsAuthentication.RedirectFromLoginPage(userIAmUsing, false);

When I close the browser in IE and Firefox. My session variables are destroyed and I am asked to re-login when I return to the page. However, in my Chrome settings I have the "Continue where I left off" setting checked. When I close the browser in Chrome, it is persisting the cookie against my (the developer's) wishes. In fact, even after I have logged out of my machine, the session is persisted. That being the situation, does anyone know of any thing that I can do as a developer to override this behavior and not allow the session to persist after browser close? In other words, can I make Chrome behave exactly like other browsers even if the user has checked that setting?

like image 545
done_merson Avatar asked Jul 27 '12 17:07

done_merson


People also ask

Does session end when browser closed?

If you close the web browser window without closing the connection session, the session remains active.

How do I remove session variables in browser?

We can clear the session storage by using the clear() method.

How do I keep Chrome browser sessions alive?

The idle browser tab will time out even if you are actively doing something on another tab of the browser or scrolling through the idle web page. The solution is to “refresh” the idle tab (which reloads the website) by clicking the curved arrow icon at the right side of the Web address bar.


1 Answers

Cookies and sessions both have timeouts. You can set the timeouts to be short so Chrome wont try to reuse them after their time is up.

  • Set the timeout for .net session
  • Set the timeout for a cookie
like image 71
Jeff Avatar answered Sep 21 '22 17:09

Jeff