You will want to have a look at http://www.asp.net/identity as this is a great starting point for performing authentication within an ASP.NET website. It includes links to resources on how to create new project templates using OAuth, OpenId or FormsAuthentication.
You are trying to write your own kind of Forms Authentication which is not necessary. In ASP.NET MVC if you implement FormsAuthentication using ASP.NET Identity or other classes you can have those classes securely write the cookie and retrieve it for you at runtime (securely). With Forms Authentication in place on your ASP.NET MVC Website you can then decorate your controllers or action methods with decorators such as [Authorize] or [AllowAnonymous] which controls access to those resources (securely).
Please have a look at that reference and as was suggested in comments, create a new Template in MVC and have a look at the sample code the template creates for you.