I have one PHP Application.Now i want to restrict a user to login my application if anybody already logged in the same browser? Is this possible using Cookie? which is better way of doing this?
How i do it…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use cookies to store the session id. Then the browser can be associated to only one session at a time. Use the session to store whether the user logged in. On the login page ask the session whether the user already logged in.
As with all network communication, this requires a certain amount of trust in the transmitting end (i. e. the Browser). It should therefore not be used for high risk scenarios. It’s, however, the best you can get.