You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/recipes/session-handling.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -275,15 +275,15 @@ If you are using just the local memory based sessions, there is no change detect
275
275
276
276
When using `sessionCluster` or an external cache, Lucee needs to track what has changed (which has overhead), to know whether the external cache needs to be updated.
277
277
278
-
For performance, Lucee does not constantly write back to the external cache, it enumerates the session scope to detect changes and periodically updates the cache, when it's changed / aka dirty.
278
+
At the end of each request, if a change in the session is detected, the change will be written out to the external storage.
279
279
280
-
If you aren't using `sessionCluster`, Lucee doesn't update the external cache on every change, it periodically writes out the session to the cache.
280
+
For performance, Lucee does not constantly write back to the external cache, it enumerates the session scope to detect changes and updates the external cache, when it's changed / aka dirty.
281
281
282
-
If the session is dirty (changes detected), you can use [[function-sessionCommit]] to force this write immediately.
282
+
Empty sessions are not written out to the cache, empty means a session with no user defined variables. These would only occur if you use [[function-StructKeyExists]] on the session scope, use [[function-sessionexists]] instead.
283
283
284
-
With `sessionCluster` enabled, when a change in the session is detected, the change will be written out at the end of the request.
284
+
If the session is dirty (changes detected), you can use [[function-sessionCommit]] to force this write immediately during the request.
285
285
286
-
The change detection, for performance reasons, does not do a deep inspection of nested objects or components. It only checks the top level values in the session scope for change, deeply nested or changes inside persisted components will not be detected, as this is complicated / expensive and happens at the end of every request.
286
+
The change detection, for performance reasons, did not do a deep inspection of nested objects or components, prior to 6.2.4. It only checks the top level values in the session scope for change, deeply nested or changes inside persisted components will not be detected, as this is complicated / expensive and happens at the end of every request.
287
287
288
288
Storing components in the session scope is not **recommended**, it's expensive to check for changes and it adds per request overhead serializing/deserializing (read/write) and increases the stored session size.
289
289
@@ -314,4 +314,12 @@ Since Lucee 6.2, empty sessions are only kept for up to a minute, independent of
314
314
315
315
Lucee has a `scope.log` which when set to **DEBUG** (default is ERROR) logs out very detailed information about session handling.
316
316
317
-
See [[troubleshooting]] for a guide on how to run Lucee with logging to the console.
317
+
See [[troubleshooting]] for a guide on how to run Lucee with logging to the console.
318
+
319
+
If you are writing tests, sessions are expired periodically, if you need to test short term session expiry, you can use [admin action="purgeExpiredSessions"](https://luceeserver.atlassian.net/browse/LDEV-4819)
0 commit comments