Felbook.Models.FormsAuthenticationService.SignIn C# (CSharp) Method

SignIn() public method

public SignIn ( string userName, bool createPersistentCookie ) : void
userName string
createPersistentCookie bool
return void
        public void SignIn(string userName, bool createPersistentCookie)
        {
            if (String.IsNullOrEmpty(userName)) throw new ArgumentException("Value cannot be null or empty.", "userName");

            FelBookDBEntities db = new FelBookDBEntities();

            db.UserSet.Single(u => u.Username == userName).LastLogged = DateTime.Now;
            db.SaveChanges();

            FormsAuthentication.SetAuthCookie(userName, createPersistentCookie);
        }
FormsAuthenticationService