How can i read cookies in asp.net mvc method?

Viewed 6050

I'm new in asp.net mvc and want to read cookies ,for that purpose write in cookies with this code:

Cookies.SaveCookies(validate);


not wan't read that cookies in this method:

public static int CookiesReturn()
        {
            if (Request.Cookies["userName"] != null)
                return  Server.HtmlEncode(Request.Cookies["userName"].Value);

        }


but in the get error on Request.Cookies:

Can not resolve Request

and too in this line Server.HtmlEncode... get this error:

Can not resolve Request

1 Answers
Related