Save get Cookie public class Operatorprovider {public static operatorprovider Provider { get {return new Operatorprovider ();} } private String loginuserkey = "LoginUser2017"; private string loginprovider = Configs.getvalue ("Loginprovider"); Public Operatormodel GetCurrent () {Operatormodel Operatormodel = new Operatormodel (); if (Loginprovider = = "Cookie") {Operatormodel = Desencrypt.decrypt (Webhelper.getcookie (loginuse Rkey). ToString ()). Toobject<operatormodel> ();//Decrypt Coookie to obtain the current logged-in user information} else {//by decrypting Session Gets the login user information Operatormodel = Desencrypt.decrypt (Webhelper.getsession (Loginuserkey). ToString ()). Toobject<operatormodel> ();//Decrypt Coookie to obtain the current login user information} return Operatormodel; } public void Addcurrent (Operatormodel operatormodel) {if (LoginproVider = = "Cookie") {//write cookie and encrypt Webhelper.writecookie (Loginuserkey, Desencryp T.encrypt (Operatormodel.tojson ()), 60); } else {//write session and Encrypt webhelper.writesession (Loginuserkey, DESENCR Ypt. Encrypt (Operatormodel.tojson ())); }//Get software ID webhelper.writecookie ("Schedule_mac", Md5.md5 (Network.getmacbynetworkinterface (). ToJson (), 32)); Webhelper.writecookie ("Schedule_licence", Licence.getlicence ()); } public void Removecurrent () {if (Loginprovider = = "Cookie") {Webhel Per. Removecookie (Loginuserkey.trim ()); } else {webhelper.removesession (Loginuserkey.trim ()); } } }
ASP. NET Cookie added Delete get