Skip to content

Commit ac62862

Browse files
joshtrichardsskjnldsv
authored andcommitted
chore: update session docs based on review feedback
Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent 291a8e1 commit ac62862

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

developer_manual/basics/controllers.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ transparent encryption layer via the ``CryptoSessionData`` class. Data written t
232232
``OCP\ISession`` API benefits from these optimizations and is automatically encrypted at rest.
233233

234234
.. danger::
235-
Never use PHP superglobals like ``$_SESSION``. This bypasses Nextcloud's encryption and
236-
lifecycle management. leading to race conditions or lost data.
235+
Never use the PHP superglobal ``$_SESSION``. The superglobal bypasses Nextcloud's encryption and
236+
lifecycle management, leading to race conditions or lost data.
237237

238238
Basic usage
239239
~~~~~~~~~~~
@@ -305,6 +305,9 @@ Use the ``#[UseSession]`` attribute when:
305305
I/O overhead from repeated open/close cycles).
306306
* **Reference Manipulation**: You need the session to remain open for complex logic or to ensure data
307307
consistency throughout the method.
308+
* **Regenerating session ids**: You are elevating a user's privileges (e.g. a valid share password is
309+
entered and the "access granted" status is stored in the session) or the user performs a sensitive
310+
alteration (e.g. password change).
308311

309312
.. note::
310313
The ``#[UseSession]`` attribute was introduced in Nextcloud 26. Previously, this feature used the

0 commit comments

Comments
 (0)