首页 > 代码库 > 基本类-CookieStorage

基本类-CookieStorage

简单建立Cookie:

public enum CookieKey    {        UserLogin    }    public class CookieStorage    {        private const int LOGINEXPIRESTIME = 24 * 60;        public static object SetCookie(CookieKey key, string value)        {            HttpCookie cookie = HttpContext.Current.Request.Cookies[key.ToString()];            if (cookie == null)            {                cookie = new HttpCookie(key.ToString());                string result = HttpUtility.UrlEncode(value);                cookie.Value = http://www.mamicode.com/result;>

  

基本类-CookieStorage