![]() And also in Symfony, events are handled as Services. In the Symfony http foundation, the Request and Response are dispatched as events. This sounds like a Service to me.įinally, cookies are a part of the Request and Response flow of the system, so we need to be able to integrate our cookie data into this flow. It should be accessible by other parts of the system, and the modification of this data should be easy and reliable. We want to create a reliable API for this data, and that API should be a real citizen of the system. The next consideration is that cookie data is global data. Let’s forget about those functions forever. The first problem with using Drupal’s legacy cookie functions is easily solved by avoiding those functions completely. Drupal’s legacy cookie functions ( user_cookie_save() and user_cookie_delete()) are incompatible with symfony cookie management because of how the Drupal functions prefix the cookie names.And the setting of new values for the cookie is a part of the Response the system returns to the visitor. Their current values are submitted to the system as a part of a Request made by the visitors. Cookies are a part of both the Request and Response.Meaning we don’t have control over the data, we can’t inject it as a dependency, and as more parts of the system use the $_COOKIE data directly the more those parts become implicitly dependent on each other and on an unreliable statefulness. ![]()
0 Comments
Leave a Reply. |