asp.netÖÐcookieµÄ´¦Àí
ÔÎÄ£ºÁõÎä|asp.netÖÐcookieµÄ´¦Àí
ʹÓÃÖз¢ÏÖÓÃRequest.Cookies.Remove()ÎÞ·¨É¾³ýcookie,googleÁËһϷ¢ÏÖÒ»°ãÊÇͨ¹ý½«¹ýÆÚʱ¼äÉèÖóɹýÈ¥µÄʱ¼äÀ´Íê³Éɾ³ýµÄ¡£Ë³±ãÕûÀíÏÂcookieµÄ²Ù×÷£º
Ò» ´´½¨
1 µ¥ÖµµÄ´´½¨
C#-Code:
HttpCookie hc = new HttpCookie("Value");
hc.Value = "value";
Response.AppendCookie(hc);
2 ¶àÖµµÄ´´½¨
C#-Code:
HttpCookie hc = new HttpCookie("Value");
hc["Value1"] = "value1";
hc["Value2"] = "value2;
Response.AppendCookie(hc);
¶þ ¶ÁÈ¡
1 µ¥ÖµµÄ¶ÁÈ¡
C#-Code:
string value = Request.Cookies["Value"].Value;
2 ¶àÖµµÄ¶ÁÈ¡
C#-Code:
string value1 = Request.Cookies["Value"]["Value1"].ToString();
string value2 = Request.Cookies["Value"]["Value2"].ToString();
Èý ɾ³ý
C#-Code:
HttpCookie hc = Request.Cookies["Value"];
hc.Expires = DateTime.Now.AddDays(-1);
//ÏÂÃæÕâ¾äÒ»¶¨Òª¼ÓÉÏ£¬·ñÔòÎÞ·¨É¾³ý
Response.AppendCookie(hc);
Ïà¹ØÎĵµ£º
×î½ü¼¸ÖÜ£¬ÔÚ²©¿Í¡¢TwitterºÍÂÛ̳ÉÏÈç»ðÈçݱµØÕ¹¿ªÁËÒ»³¡ÌÖÂÛ¡£ÌÖÂÛµÄÄÚÈÝÊÇ£º¿ª·¢ÈËÔ±ÊÇ·ñÓ¦¸ÃʹÓûòѧϰASP.NET MVC¡£´Ó“²»ÍƼöѧϰ”µ½“ËùÓÐASP.NET¿ª·¢ÈËÔ±¶¼Ó¦¸Ãѧϰ”£¬¸÷ÖÖ²»Í¬µÄ¹Ûµã²ã³ö²»Çî¡£InfoQ¶ÔÆäÖв¿·ÖÌÖÂÛÄÚÈݽøÐÐÁË×ܽᡣ
Rob Conerey£¨SubSonicÖ®¸¸£¬Ä¿Ç°ÊÇ΢ÈíASP.NET MVCÍÅ¶ÓµÄ ......
ASP.Net 1.1ºóÒýÈëÁ˶ÔÌá½»±íµ¥×Ô¶¯¼ì²éÊÇ·ñ´æÔÚXSS(¿çÕ¾½Å±¾¹¥»÷)µÄÄÜÁ¦¡£µ±Óû§ÊÔͼÓÃÖ®ÀàµÄÊäÈëÓ°ÏìÒ³Ãæ·µ»Ø½á¹ûµÄʱºò£¬ASP.NetµÄÒýÇæ»áÒý·¢Ò»¸ö HttpRequestValidationExceptioin¡£Ä¬ÈÏÇé¿öÏ»᷵»ØÈçÏÂÎÄ×ÖµÄÒ³Ã棺
ÒÔÏÂÊÇÒýÓÃƬ¶Î£º
Server Error in '/YourApplicationPath' Application
A potentially dangerou ......
¹ØÓÚASP.NETÒ³Ãæ´òÓ¡¼¼ÊõµÄ×ܽá
B/S½á¹¹µ¼ÖÂÁËWebÓ¦ÓóÌÐòÖдòÓ¡µÄÌØÊâÐÔ¡£
¡¡¡¡• ³ÌÐòÔËÐÐÔÚä¯ÀÀÆ÷ÖУ¬´òÓ¡»úÔÚ±¾µØ£¬¶øÎļþÈ·¿ÉÄÜÔÚ·þÎñÆ÷ÉÏ£¬µ¼ÖÂÁË´òÓ¡¿ØÖƲ»ÊǺÜÁé»î¡£
¡¡¡¡• ¸ñʽÈçºÎ¿ØÖƺͶ¨ÖƵȣ¬ÊÇÎÒÃÇ¿ª·¢ÖпÉÄÜ»áÃæ¶ÔµÄÎÊÌâ¡£
¡¡¡¡´òÓ¡ÎĵµµÄÉú³É
¡¡¡¡• 1¡¢ ......
×î½ü·ÃÎÊÁ˽¨ÐÐÍøվʱ https://ibsbjstar.ccb.com.cn/V5/index.html#£¬£¨ÆäʵÔÚoblog,http://www.oblog.cnÒ²²ÉÓÃÁËÀàËƵļ¼ÇÉ£¬²»¹ý·½·¨²»Í¬°ÕÁË£©
¡¡¡¡¿ÉÒÔ·¢ÏÖ£¬µ±Ñ¡Ôñ²»Í¬µÄÎı¾¿ò£¬¿ÉÒÔ³öÏÖ²»Í¬µÄÑÕÉ«£¬ÒªÍê³ÉÕâ¸ö¹¦Äܼܺòµ¥£¬µ«ÊÇÈç¹ûÓкܶàÀàËƵŦÄÜ£¬Èç¹ûÒ»¸ö¸öÉèÖÿؼþÑùʽÏÔÈ»ºÜÀÛ£¬Ò»¸ö¼òµ¥µÄ´¦Àí·½·¨Ð´Ò»¸ö·½· ......