mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-08 18:51:12 +02:00
I've decoupled `Cookie` from the actual act of setting and getting cookies. Currently there are a few limitations to how Cookie works that this change mitigates: 0. `Cookie` currently changes the super global `$_COOKIE` when setting to make the state of an application a bit more managable, but this is bad because we shouldn't be modifying super globals 0. One can't actually change the `$cookie_class` once the `Cookie::$inst` has been instantiated 0. One can't test cookies as there is no class that holds the state of the cookies (it's just held in the super global which is reset as part of `Director::test()` 0. One can't tell the origin of a cookie (eg: did the application set it and it needs to be sent, or did we receive it from the browser?) 0. `time()` was used, so testing was made difficult 0. There was no way to get all the cookies at once (without accessing the super global) Todos are on the phpdoc and I'd like to write some tests for the backend as well as update the docs (if there are any) around cookies. DOCS Adding `Cookie` docs Explains basic usage of `Cookie` as well as how the `Cookie_Backend` controls the setting and getting of cookies and manages state of sent vs received cookies Fixing `Cookie` usage `Cookie` is being used inconsistently with the API throughout framework. Either by not using `force_expiry` to expire cookies or setting them to null and then expiring them (which is redundant). NEW `Director::test()` takes `Cookie_Backend` rather than `array` for `$cookies` param |
||
---|---|---|
.. | ||
_images | ||
aspects.md | ||
bbcode.md | ||
cms-architecture.md | ||
cookies.md | ||
database-structure.md | ||
dataextension.md | ||
dataobject.md | ||
datefield.md | ||
director.md | ||
execution-pipeline.md | ||
form-field-types.md | ||
grid-field.md | ||
image.md | ||
index.md | ||
injector.md | ||
layout.md | ||
member.md | ||
modeladmin.md | ||
partial-caching.md | ||
permission.md | ||
preview.md | ||
requirements.md | ||
restfulservice.md | ||
rssfeed.md | ||
searchcontext.md | ||
shortcodes.md | ||
site-reports.md | ||
siteconfig.md | ||
sitetree.md | ||
sqlquery.md | ||
tablefield.md | ||
tablelistfield.md | ||
templates-formal-syntax.md | ||
templates-upgrading-guide.md | ||
templates.md | ||
typography.md | ||
uploadfield.md | ||
urlvariabletools.md |