The difference between ASP and ASP.NET in cookie

xiaoxiao2021-03-06  42

//Asp.net

//read

Request.cookies ("test"). Value;

//write

Var cookie: httpcookie = new httpcookie ("test");

Cookie .Value = "abc";

Response.cookies.add (cookie);

// ASP

//read

Request.cookies ("Test");

//write

Response.cookies ("Test"

) = "abc";

// If the cookie is created for the ASP, you need to decode the following method in .NET, otherwise there will be garbled problems.

System.Web.httputility.urdecode (c, system.text.encoding.default);

转载请注明原文地址:https://www.9cbs.com/read-53223.html

New Post(0)