42 lines
984 B
C#
42 lines
984 B
C#
using System;
|
|
using System.IO;
|
|
using System.Text;
|
|
namespace ln.http
|
|
{
|
|
public class HttpCookie
|
|
{
|
|
public String Name { get; set; }
|
|
public String Value { get; set; }
|
|
|
|
public bool Secure { get; set; }
|
|
public DateTime Expires { get; set; }
|
|
public String Path { get; set; }
|
|
public String Domain { get; set; }
|
|
|
|
public HttpCookie(String name)
|
|
{
|
|
Name = name;
|
|
}
|
|
public HttpCookie(String name,String value)
|
|
{
|
|
Name = name;
|
|
Value = value;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
stringBuilder.AppendFormat("{0}={1}", Name, Value);
|
|
if (Secure)
|
|
stringBuilder.Append(";SECURE");
|
|
|
|
if (Path != null)
|
|
stringBuilder.AppendFormat(";Path={0}", Path);
|
|
|
|
return stringBuilder.ToString();
|
|
}
|
|
|
|
|
|
}
|
|
}
|