Login and session management in Asp.net Mvc 4 -
I want to create an application in which different user login functionality such as administrator, coach and student each have their own work So here I want to deal with the session and I am new to asp.net mvc.
Here's an example, let's say that we want to manage the session after verifying user verification, Therefore, it is difficult to check the valid user only for this demo account login
public performance login (login model model) {if (model.UserName == "xyz" & model.Password == "xyz") {session ["uname"] = model User name; Session Timeout = 10; Return Redirect Action ("Index"); } {If the session ["uname"] == faucet) {return redirection ("/" /> Account access "); } And {return content ("welcome" + session ["anonymous"]); }}
On the signature button
session. Remove ("uname"); Redirect Return ("~ / Account / Login");
Comments
Post a Comment