Avoid user login twice in an application

Posted by Ganeshms87 under ASP.NET on 11/1/2012 | Points: 10 | Views : 1596 | Status : [Member] | Replies : 9
How to restrict the same user login twice in an application in asp.net




Responses

Posted by: Saratvaddilli on: 11/1/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
can you please explain your question .
if an user is able to login only once then he will not register
ok if you want the same then do these
when ever user clicks logout just delete the record from the usertable


Thanks and Regards
V.SaratChand
Show difficulties that how difficult you are

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

Posted by: Ganeshms87 on: 11/1/2012 [Member] Starter | Points: 25

Up
0
Down
How to delete records from user table
1.when user close the browser without clicking logout button
2.When user session expire

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

Posted by: Naraayanan on: 11/1/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
Create Temp table for login Details.
Temp Table structure:
username Password login
1212 111 Yes -- If login
1212 111 No -- If logOut
Condition :
Check login Form Open or not.
If login Form open
Call the Temp Details
If User already logined, close the Application.





Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

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

Posted by: Ganeshms87 on: 11/1/2012 [Member] Starter | Points: 25

Up
0
Down
Thats right But,
How to delete records from Temp table
1.when user close the browser without clicking on logout button
2.When user session expire

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

Posted by: Saratvaddilli on: 11/1/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
call a javascript function which deletes the records from database
<body onbeforeunload="callyourfunction">


Thanks and Regards
V.SaratChand
Show difficulties that how difficult you are

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

Posted by: Naraayanan on: 11/1/2012 [Member] Starter | Points: 25

Up
0
Down
HI
1.when user close the browser without clicking on logout button
Yes , You are right .It happens ,
Try this way
username Password login
1212 111 1 -- If login
1212 111 2 -- If user uses close[X]
1212 111 0 -- If logOut
2.When user session expire

what is user session expire?

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

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

Posted by: Ganeshms87 on: 11/2/2012 [Member] Starter | Points: 25

Up
0
Down
Thanks for your reply,

In my application,when user session expire it will redirect to login.aspx page.
How to delete data from temp table when session expire

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

Posted by: Naraayanan on: 11/2/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
Please let me know what is session expire.
Use delete query .
Delete from table_name where username=''





Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

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

Posted by: Nkkppp on: 11/4/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Ganesh,

As suggested by SaratChand use onbeforeunload and write Javascript code.
(OR)
Check out this link.

http://www.beansoftware.com/ASP.NET-Tutorials/Find-If-Session-Expired.aspx



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

Login to post response