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

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -