Skip to content

Commit ece28dd

Browse files
committed
Update session-handling.md
1 parent 8c83586 commit ece28dd

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

docs/recipes/session-handling.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,15 @@ If you are using just the local memory based sessions, there is no change detect
275275
276276
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.
277277
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.
279279
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.
281281
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.
283283
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.
285285
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.
287287
288288
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.
289289
@@ -314,4 +314,12 @@ Since Lucee 6.2, empty sessions are only kept for up to a minute, independent of
314314
315315
Lucee has a `scope.log` which when set to **DEBUG** (default is ERROR) logs out very detailed information about session handling.
316316
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)
320+
321+
```
322+
<cfadmin action="purgeExpiredSessions"
323+
type="server"
324+
password="#password#">
325+
```

0 commit comments

Comments
 (0)