Click here to Skip to main content
15,885,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am want to use session manageent technique for User Login. When user login, his id will be store in session. but when he tries to login again from same browser or another broswer, it should not be allowed.
I know using sql it is possible but i want some technique other then sql.
thanks in advance.
Posted
Comments
choudhary.sumit 13-Dec-12 2:03am    
when submitting your login information:
<pre lang="c#">
Session["Username"] = txtusername.text;

//on login page on load event!

(Session["UserName"] != null)
{
Response.write("You are already logged in");
}</pre>

There is an application object, I believe, which contains data at the application scope. You can try something in there. The session is useless, because it's a different session for each browser, it can't tell that another session has the same user.
 
Share this answer
 
You can do it by using global.asax file.
Please check Limit only one session per user in ASP.NET[^] for the codes.

Thanks...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900