Commit 8aca41a
authored
Always call
This way, the handler may change the session data, and set additionalData too. This was documented as possible even before, but in reality setting additional data didn't really always store them to the sessions table. That's because nothing was written to the table when session data hasn't changed, no matter what was in additionalData. And setting additionalData in the handler did mostly nothing, because the handler was called only when there was a change in the session data aka the Catch-22 problem.
If anyone would need the handler to be executed only when session data has changed, this could be emulated by passing the result of `$this->data[$id] !== $data` as a param to the handler, and then adding an `if` in the handler.onBeforeDataWrite handlers, even if the session data does not change (#15)2 files changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
| 163 | + | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | 168 | | |
170 | 169 | | |
171 | 170 | | |
| |||
0 commit comments