[Modify] For the SameSite attribute
This commit is contained in:
		@@ -96,6 +96,7 @@ namespace WebSocketSharp.Net
 | 
			
		||||
    private string                 _port;
 | 
			
		||||
    private int[]                  _ports;
 | 
			
		||||
    private static readonly char[] _reservedCharsForValue;
 | 
			
		||||
    private string                 _sameSite;
 | 
			
		||||
    private bool                   _secure;
 | 
			
		||||
    private DateTime               _timeStamp;
 | 
			
		||||
    private string                 _value;
 | 
			
		||||
@@ -350,6 +351,16 @@ namespace WebSocketSharp.Net
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    internal string SameSite {
 | 
			
		||||
      get {
 | 
			
		||||
        return _sameSite;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      set {
 | 
			
		||||
        _sameSite = value;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #endregion
 | 
			
		||||
 | 
			
		||||
    #region Public Properties
 | 
			
		||||
@@ -768,6 +779,9 @@ namespace WebSocketSharp.Net
 | 
			
		||||
      if (!_domain.IsNullOrEmpty ())
 | 
			
		||||
        buff.AppendFormat ("; Domain={0}", _domain);
 | 
			
		||||
 | 
			
		||||
      if (!_sameSite.IsNullOrEmpty ())
 | 
			
		||||
        buff.AppendFormat ("; SameSite={0}", _sameSite);
 | 
			
		||||
 | 
			
		||||
      if (_secure)
 | 
			
		||||
        buff.Append ("; Secure");
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -526,6 +526,17 @@ namespace WebSocketSharp.Net
 | 
			
		||||
          continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (name.Equals ("samesite", caseInsensitive)) {
 | 
			
		||||
          if (cookie == null)
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
          if (val.Length == 0)
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
          cookie.SameSite = val.Unquote ();
 | 
			
		||||
          continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (cookie != null)
 | 
			
		||||
          ret.add (cookie);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user