33// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
44
55using System ;
6+ using System . ComponentModel ;
67using System . Diagnostics ;
78using CefSharp . Enums ;
89
@@ -49,11 +50,11 @@ public sealed class Cookie
4950 /// <summary>
5051 /// The cookie creation date. This is automatically populated by the system on cookie creation.
5152 /// </summary>
52- public DateTime Creation { get ; set ; }
53+ public DateTime Creation { get ; private set ; }
5354 /// <summary>
5455 /// The cookie last access date. This is automatically populated by the system on access.
5556 /// </summary>
56- public DateTime LastAccess { get ; set ; }
57+ public DateTime LastAccess { get ; private set ; }
5758 /// <summary>
5859 /// Same site.
5960 /// </summary>
@@ -62,5 +63,35 @@ public sealed class Cookie
6263 /// Priority
6364 /// </summary>
6465 public CookiePriority Priority { get ; set ; }
66+
67+ /// <summary>
68+ /// Used internally to set <see cref="Creation"/>.
69+ /// <see cref="Creation"/> can only be set when fecting a Cookie from Chromium
70+ /// </summary>
71+ /// <param name="dateTime">dateTime</param>
72+ /// <remarks>
73+ /// Hidden from intellisense as only meant to be used internally, unfortunately
74+ /// VC++ makes it hard to use internal classes from C#
75+ /// </remarks>
76+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
77+ public void SetCreationDate ( DateTime dateTime )
78+ {
79+ Creation = dateTime ;
80+ }
81+
82+ /// <summary>
83+ /// Used internally to set <see cref="LastAccess"/>.
84+ /// <see cref="LastAccess"/> can only be set when fecting a Cookie from Chromium
85+ /// </summary>
86+ /// <param name="dateTime">dateTime</param>
87+ /// <remarks>
88+ /// Hidden from intellisense as only meant to be used internally, unfortunately
89+ /// VC++ makes it hard to use internal classes from C#
90+ /// </remarks>
91+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
92+ public void SetLastAccessDate ( DateTime dateTime )
93+ {
94+ LastAccess = dateTime ;
95+ }
6596 }
6697}
0 commit comments