Sharing a Web Application Session Using a Web Service

Environment:

We have a Website and a separate ASMX - a web service that uses the same database (MS SQL 2008). At the moment, the web service is for mobile applications. Projects are performed using C #, Asp.Net, 3.5 framework, VS 2008.

Requirements:

We need to avoid the same user login to the website and mobile application (using the web service) at the same time. Basically, a user can enter only one service at a time (both on the Internet and in the application). In addition, the user should be able to log in to the Mobile App as soon as the web browser is closed or logs out.

If a user tries to log in, although he has already registered with another service, the code must have a way to find it for notification and restriction purposes.

I think AppFabrc fixes this requirement, but needs Windows Server 2008 R2, which we don’t have at the moment.

Hope you have some better ideas?

Note that this is not the same question as this .

+4
source share
2 answers

FYI ... you do not receive notifications when the browser closes. You can go to the last time of activity (basically track user activity - clicks on pages, etc.). I also don't see how appFabric will help. You still have the same problems.

0
source

As already mentioned, there is no easy way to find out when someone has closed the browser. You can use javascript to detect when someone leaves your web application, but there are some problems (see the following question and answers for more information: How to capture the browser window closing event? )

If you are open to other workflows, you can try the following:

  • When the user logs into the mobile application, launch the mobile application from the website.
  • When a user logs in to the website, the website will log him out of the mobile application.

Thus, your users will log in and immediately start working, instead of logging in, seeing an error, logging out of another application, logging in again.

0
source

Source: https://habr.com/ru/post/1402450/


All Articles