Skip to content

Commit 039621f

Browse files
committed
improve session handling recipe
1 parent 750cad1 commit 039621f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/recipes/session-handling.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,30 @@ or environment variable
200200
LUCEE_READ_CFID_FROM_URL=false
201201
```
202202
203+
### Client Identification in CFID
204+
Lucee can enhance session security by embedding client information within the CFID. This feature helps prevent session hijacking by making it harder for one client to use another client's CFID.
205+
206+
Enable this feature using either system property:
207+
```properties
208+
-Dlucee.identify.client=true
209+
```
210+
or environment variable:
211+
```bash
212+
LUCEE_IDENTIFY_CLIENT=true
213+
```
214+
215+
When enabled:
216+
- The CFID includes a unique client identifier based on the client's characteristics (e.g., User-Agent)
217+
- A session created for Client A cannot easily be used by Client B
218+
- Maintains backward compatibility with older CFID patterns
219+
- Sessions remain valid when downgrading Lucee versions
220+
221+
The client identification is derived from:
222+
1. User-Agent header
223+
2. If not available, falls back to accept header
224+
3. If no identifying information is available, reverts to standard CFID generation
225+
226+
203227
## Best Practices
204228
205229
Lucee tries to avoid creating sessions whenever possible. It only creates a session when:

0 commit comments

Comments
 (0)