Hi,
What is the best way to implement the unique login control.
I have a idea, which is everytime the user login, will create a unique Key[$UKey] (randomly generated) and save into db. So everytime the user read any link/page , i will use this key to match the $UKey with the db record. In additional, I will check if within 3 minute if anyone try to login with different $UKey, the system will treat it as concurrent access happen and stop the login. That's fine and it work.
Now, let say the user close the page OR disconnect , and relogin, the problem rise:
---> user will not able to login within 3 minute since the new $UKey is not match withthe new $UKey.
So what i think is:
1) create a cookie which last for 1 hour for the $UKey, so as long as the user using the same pc, so able to use this $UKey when doing verification, prevent from 'deadlock' happend for 3 minute if the user didnt' logout properly.
2) OR other better solution?