How to avoid multiple login of user in same session.... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How to avoid multiple login of user in same session....

in this problem user can only use there session at a single PC..single browser .

9th Mar 2017, 9:29 AM
Dhanaji Yadav
Dhanaji Yadav - avatar
3 Answers
+ 2
Session session = request.getSession(false); if session == null session.invalidate() session = request.getSession(true) try this in your doPost method of the servlet when the user is logging in. hope this helps
10th Mar 2017, 4:57 AM
Michael Szczepanski
Michael Szczepanski - avatar
0
if (!isset($_SESSION['name'])){ header('location: login.php'); }else { $_SESSION['name']; }
30th Mar 2017, 5:35 PM
Ardani Yunia Rizki
Ardani Yunia Rizki - avatar
0
use HttpSessionBindingListener
2nd Apr 2017, 8:00 AM
Vinoth Kumar Ranganathan
Vinoth Kumar Ranganathan - avatar