Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ToServerString()

string System.Net.Cookie.ToServerString ( )
inlinepackage

Definition at line 672 of file Cookie.cs.

673 {
674 string text = Name + "=" + Value;
675 if (m_comment != null && m_comment.Length > 0)
676 {
677 text = text + "; Comment=" + m_comment;
678 }
679 if (m_commentUri != null)
680 {
681 text = text + "; CommentURL=\"" + m_commentUri.ToString() + "\"";
682 }
683 if (m_discard)
684 {
685 text += "; Discard";
686 }
687 if (!m_domain_implicit && m_domain != null && m_domain.Length > 0)
688 {
689 text = text + "; Domain=" + m_domain;
690 }
692 {
693 int num = (int)(Expires.ToLocalTime() - DateTime.Now).TotalSeconds;
694 if (num < 0)
695 {
696 num = 0;
697 }
698 text = text + "; Max-Age=" + num.ToString(NumberFormatInfo.InvariantInfo);
699 }
700 if (!m_path_implicit && m_path != null && m_path.Length > 0)
701 {
702 text = text + "; Path=" + m_path;
703 }
704 if (!Plain && !m_port_implicit && m_port != null && m_port.Length > 0)
705 {
706 text = text + "; Port=" + m_port;
707 }
708 if (m_version > 0)
709 {
710 text = text + "; Version=" + m_version.ToString(NumberFormatInfo.InvariantInfo);
711 }
712 if (!(text == "="))
713 {
714 return text;
715 }
716 return null;
717 }
DateTime Expires
Definition Cookie.cs:159
string m_path
Definition Cookie.cs:36
bool m_path_implicit
Definition Cookie.cs:38
bool m_domain_implicit
Definition Cookie.cs:30
bool m_port_implicit
Definition Cookie.cs:42
string m_domain
Definition Cookie.cs:28
string m_comment
Definition Cookie.cs:20
string m_port
Definition Cookie.cs:40
override string ToString()
Definition Uri.cs:1119
static readonly DateTime MinValue
Definition DateTime.cs:35
static DateTime Now
Definition DateTime.cs:103
DateTime ToLocalTime()
Definition DateTime.cs:1068

References System.Net.Cookie.Expires, System.Globalization.NumberFormatInfo.InvariantInfo, System.Net.Cookie.m_comment, System.Net.Cookie.m_commentUri, System.Net.Cookie.m_discard, System.Net.Cookie.m_domain, System.Net.Cookie.m_domain_implicit, System.Net.Cookie.m_path, System.Net.Cookie.m_path_implicit, System.Net.Cookie.m_port, System.Net.Cookie.m_port_implicit, System.Net.Cookie.m_version, System.DateTime.MinValue, System.Net.Cookie.Name, System.DateTime.Now, System.Net.Cookie.Plain, System.text, System.DateTime.ToLocalTime(), System.Uri.ToString(), and System.Net.Cookie.Value.