1

Topic: sessionstorage how to store a flag at browser closing?

Good afternoon, there is a simple task - the algorithm = is necessary there is a browser, there is a tab, in it open a site - at login in sessionstorage - we put ID - in js is checked that it is is guarantees that the person works with a site only through 1 tab... If it opened the second - in it sessionstorage will not be ID - and js  a site and operation in the second the contribution is impossible.... All perfectly works... But if to close the browser - or the tab sessionstorage - it is dropped, but session server is not closed... And how then to be? What algorithm to invent to define that is opened to one tab?
Example which shows that counters different:
https://www.w3schools.com/jsref/tryit.a … onstorage2
https://www.w3schools.com/jsref/tryit.a … onstorage2

2

Re: sessionstorage how to store a flag at browser closing?

Atum1;
Counter question - and how you will assort authorization from 2-3-N browsers?
With such restrictions - write android/ios application and forget about web.

3

Re: sessionstorage how to store a flag at browser closing?

Ruslan Damirovich;
It already on the server through maximumSessions ()

http.sessionManagement ().maximumSessions (1)

http://www.baeldung.com/spring-security-session

4

Re: sessionstorage how to store a flag at browser closing?

, at repeated authorization of the user it is necessary  existing session. If the user became authorized - means, for any reasons the previous session is not necessary to it.

5

Re: sessionstorage how to store a flag at browser closing?

Atum1 wrote:

and js  a site and operation in the second the contribution it is impossible.

And ?

6

Re: sessionstorage how to store a flag at browser closing?

behind a board wrote:

it is passed...
And ?

Is  - it works on  - two tabs - the double information from  - races...

7

Re: sessionstorage how to store a flag at browser closing?

Atum1 wrote:

it is passed...
Is  - it works on  - two tabs - the double information from
- races...

Not so understood your answer (.

8

Re: sessionstorage how to store a flag at browser closing?

Atum1;
I repeat a question what will be if someone opens 2 different browsers (IE/CHROME/FF) - that you will do?
Hint, hammer on restrictions of the client, invent, as to the server to distinguish 2 + open tabs and to work only with one session - the latest.
For certain the exchange goes through ajax.
For example at reversal to the base page, each time to generate a token which will be transferred then from the client - all previous tokens at comparing will be rejected.
P.S.  and . Chrome and  a word underline.

9

Re: sessionstorage how to store a flag at browser closing?

in Damirovich wrote:

the Hint, hammer on restrictions of the client,

+1
I am not cut, he/she is the client enters into a stupor the server printing on  simultaneously two tabs or the scanner a code dash?
the case is necessary!

10

Re: sessionstorage how to store a flag at browser closing?

;
I think yes. Simply foreheads did not understand technologies and commanded - not !
Session only one, the tab only one and the monitor screen only one.
Earlier still  the second start did not resolve.
Imho.

11

Re: sessionstorage how to store a flag at browser closing?

;
Well I above told that to me it is clear nothing.
And as he is silent, means itself understood that setting a curve.

12

Re: sessionstorage how to store a flag at browser closing?

13

Re: sessionstorage how to store a flag at browser closing?

Atum1 wrote:

On localhost the server

cool) is launched
I so understood that the server and the unique client in one bottle. Almost the payment terminal )).

14

Re: sessionstorage how to store a flag at browser closing?

wrote:

it is passed...
Then about what races there can be a speech? One page is active always. From it also there is a mailing, and that that on ws is delivered under all tabs - so it is a defect of logic of the server. It is possible to send only there whence came.
it is passed...
The normal decision. Such it is possible to make on each computer, and to address to iron through .
The primitive listener ws on tomcat and here the browser works with iron.

c WS  is not present.
There is a problem with local servers which work on JSONP
On each page it is executed js - for operation acceleration - this js - obtaining the data from periphery - does a post request about the server.
Two tabs - two identical requests about the server with the identical data.
Here a candidate solution only one - to put the data from periphery in localStorage - and to put a flag - if came repeated data them not to send;
Only such here a crutch.

15

Re: sessionstorage how to store a flag at browser closing?

Atum1;
"Booth" mode (kiosk mode)
?

16

Re: sessionstorage how to store a flag at browser closing?

wrote:

JSONP

the customer can ask.
It is more convenient to put in process than in ws