3
3
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4
4
5
5
using System ;
6
+ using System . ComponentModel ;
6
7
using System . Diagnostics ;
7
8
using CefSharp . Enums ;
8
9
@@ -49,11 +50,11 @@ public sealed class Cookie
49
50
/// <summary>
50
51
/// The cookie creation date. This is automatically populated by the system on cookie creation.
51
52
/// </summary>
52
- public DateTime Creation { get ; set ; }
53
+ public DateTime Creation { get ; private set ; }
53
54
/// <summary>
54
55
/// The cookie last access date. This is automatically populated by the system on access.
55
56
/// </summary>
56
- public DateTime LastAccess { get ; set ; }
57
+ public DateTime LastAccess { get ; private set ; }
57
58
/// <summary>
58
59
/// Same site.
59
60
/// </summary>
@@ -62,5 +63,35 @@ public sealed class Cookie
62
63
/// Priority
63
64
/// </summary>
64
65
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
+ }
65
96
}
66
97
}
0 commit comments