Replies: 6 comments
-
I am curious on the use case, can you elaborate? |
Beta Was this translation helpful? Give feedback.
-
When performing asynchronous operations, data required for these operations can be temporarily stored in the session using other events. Then, the data can be retrieved in the For example, if you want to send information about an "add to wishlist" action to an analytics provider. |
Beta Was this translation helpful? Give feedback.
-
Have you look at the original PR #1592, which is very specific on closing the session. Your proposed change would modify that. |
Beta Was this translation helpful? Give feedback.
-
I read it, but there are any better solutions for this type of scenarios? It must be save to db or a queue? |
Beta Was this translation helpful? Give feedback.
-
Finally I have created a simple queue module to do this. |
Beta Was this translation helpful? Give feedback.
-
You can simply store the data in any model (not in session) with a destruct method that perform the sync. With the mentioned PR, destruct methods are called after response flushes, so there is no incidence for the client. |
Beta Was this translation helpful? Give feedback.
-
It's more convenient to edit session in core_app_run_after event. What do you think?
Beta Was this translation helpful? Give feedback.
All reactions