You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expiry value is a Unix timestamp of the time the cookie expires (0 expires at the end of the current session).
28
-
29
-
##### Default expiry
30
-
31
-
The default expiry is 90 days. This can be configured:
32
-
33
-
```yaml
34
-
SilverStripe\Control\Cookie:
35
-
default_cookie_expiry_days: 90
36
-
```
37
-
38
-
##### Deprecation: `Cookie::set()` `$expiry` in days
39
-
40
-
In previous versions of SilverStripe, expiry was expressed in days e.g `Cookie::set($name, $value, $expiry = 90)`. This has been deprecated, and will invoke a deprecation notice. If you are experience the deprecation notice, but are unable to control or resolve the cause, the notice can be suppressed using the configuration:
41
-
42
-
```yaml
43
-
SilverStripe\Control\Cookie:
44
-
suppress_expiry_as_timestamp_notice: true
45
-
```
46
-
**WARNING Notice should only be suppressed if no further resolution can be met.**
47
-
48
-
49
-
###### Customising legacy expiry support
50
-
51
-
The legacy expiry behaviour can be extended.
52
-
53
-
```yaml
54
-
SilverStripe\Control\CookieJar:
55
-
extensions:
56
-
- CookieJarExtension
57
-
```
58
-
59
-
```php
60
-
class CookieJarExtension extends DataExtension
61
-
{
62
-
63
-
public function updateLegacyExpiry($expiry)
64
-
{
65
-
// Customisation goes here
66
-
}
67
-
}
68
-
```
27
+
SilverStripe's default `Cookie_Backend` supports `$expiry` as
28
+
- Days: The number of days until the cookie expires
0 commit comments