i want to do if a person login from state A(this is his home town) and after 2 hours the same account login again by another state B. then ask a security Answer.
How i can check this. with the help of cookie or any thing else
i want to do if a person login from state A(this is his home town) and after 2 hours the same account login again by another state B. then ask a security Answer.
How i can check this. with the help of cookie or any thing else
You can't check for this. IP geolocation is not nearly accurate enough.
From my desk right now, I have 3 IP addresses. One in Illinois, another in Missouri (cell phone provider has registered their IPs there), and a proxy server on a VPS in Europe. In addition, it's common for addresses to change regularly.
Consider using two-factor authentication if you want to increase your security standards.