Currently I have a client and admin webpage. There are multiple users who will login to the client page. While in admin page, when I restored the database inside the admin page, I need to logout all the users who are currently login to the client page. Any ideas how it should be done? My current language using is classic ASP. If it can be done in ASP.NET, its fine too. Thanks.
相关问题
- java client program to send digest authentication
- PHP persistent login - Do i reissue a cookie after
- How to handle “App is temporarily blocked from log
- If condition not working in classic ASP
- passport.authenticate() using a Promise instead of
相关文章
- Can a VBScript function return a dictionary?
- User.Identity.IsAuthenticated vs WebSecurity.IsAut
- SwiftUI - Vertical Centering Content inside Scroll
- Override UserManager in django
- Your application has authenticated using end user
- ZURB Foundation, switching tab programmatically
- Access Token for Dockerhub
- Django: Creating a superuser with a custom User mo
It really depends what you've cached. If it's data then you can clear the cached data rather than forcing your users to login again.
If it's data or permissions / security change then you could have a setting in your database called SchemaVersion that stores the current version of the database. Each logged in user request to the app could compare the cookie / session version against the one in the database and if it differs to get the client to delete the session / cookie and force a re-login.
According to a Microsoft help article you can reset the session like this:
And from MSDN you can clear your cookie like this:
This should force a login, but I haven't confirmed this myself.
So in summary, you can use the ASP.NET Cache to store the db schema version and:
At the start of the page load call a helper class
LoginResetHelper.IsDbValid()
to see if we need to login againIn the helper class you would ask
If IsDbValue is true, the continue as normal
If it is false, then call the
LoginResetHelper.ResetLogin()
and redirect to login page.In
ResetLogin()
you would perform the clearing functions I mentioned aboveMaybe easiest way is to define an
Application
variable indicating your website in under maintenance and, in every page through a server side include, check that variable and redirect to an appropriate error page.