Make it possible to set extradata in preResponseEvent and pass it on
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3488400. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Right now its hard to set data in the preResponseEvent that you might want to pass on to the postResponseEvent for logging reasons. We need a solution for that.</p>
<p>Useful for request time for instance.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<ul>
<li>Add a method to the PreGenerateResponseEvent called setState (or come up with a better name) that takes key and a mixed value.</li>
<li>Add a method to the PreGenerateResponseEvent called getStates that responds with an array of all data set in the setState.</li>
<li>Add a method to the PreGenerateResponseEvent called getState that takes a key and responds with mixed data set in setState.</li>
<li>Add a method to the PostGenerateResponseEvent called setState (or come up with a better name) that takes key and a mixed value.</li>
<li>Add a method to the PostGenerateResponseEvent called getStates that responds with an array of all data set in the setState.</li>
<li>Add a method to the PostGenerateResponseEvent called getState that takes a key and responds with mixed data set in setState.</li>
<li>Transfer the data from the PreGenerateResponseEvent getStates to PostGenerateResponseEvent setState so it can be transferred.</li>
</ul>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue