Only one session per user..

Posted by Hemanth.Gottipati under ASP.NET on 1/7/2013 | Points: 10 | Views : 3070 | Status : [Member] | Replies : 6
Hello All,

i want to restrict one active session per user means if with the same user name and password another user try to login he will get the message that user with same credentials is already logged in.

So how should i do that, can anyone help me in this.




Responses

Posted by: Shubham on: 1/7/2013 [Member] Starter | Points: 25

Up
0
Down
HI!!! Hemanth.Gottipati

I think you have do this save first time user name in cookies and and on login time check the cookies value or user name from database and compare the user name

Thanks&Regards:-
Shubham Choudhary
Software Engineer
www.facebook.com/shubham.kunar

Hemanth.Gottipati, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hemanth.Gottipati on: 1/7/2013 [Member] Starter | Points: 25

Up
0
Down

Hi,Thanks for ur reply...
In login page button click i will compare cookies username and databse username.cookies only work in one system..but i am logged same credentials in another system it will not work..but same browser in one system it will be working fine...
pls give me reply.....

Hemanth.Gottipati, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shubham on: 1/7/2013 [Member] Starter | Points: 25

Up
0
Down
hello hemant

its not possible to check same person to restrict to login from different machines


but if you do .... so do this
on firsttime login
save details like logintime, loginname, logindate, IP address,
and save
and if u save this record on login time on second time logine u can compare login time, loginname, and IP address




Thanks&Regards:-
Shubham Choudhary
Software Engineer
www.facebook.com/shubham.kunar

Hemanth.Gottipati, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hemanth.Gottipati on: 1/7/2013 [Member] Starter | Points: 25

Up
0
Down
Hi shubham...
its possible to restrict to login from different machines..i am writing code but it will be working fine when user click logout button..the problem is user close the browser or alt-f4 it will not working..pls give me any suggestion......
my logic is in tblusers table i have created one column login status by default i am saving 0 in these column...when the user login button click the status will be changed to 1..in these period same user logged in another system the masg will be displayed..when user logout button click status will be changed to 0...this is my logic...
but problem is user close the browser the status not be updated..so pls give me any suggestion......

Hemanth.Gottipati, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajeshk on: 1/8/2013 [Member] Starter | Points: 25

Up
0
Down
nice question hemanth ,me also have this doubt
please clarify the doubt any one whether it is posible or not ?

Thanks&Regards
rajeshkommireddy@gmail.com

Hemanth.Gottipati, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hemanth.Gottipati on: 1/8/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,Rajesh....
my suggestion is dont waste ur time....its not posiible......

Hemanth.Gottipati, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response