1
0
Fork 0

Removed 'Description' headers.

This commit is contained in:
Alan Plum 2014-06-23 16:12:10 +02:00
parent 5767abf7f2
commit 7f72d484dc
1 changed files with 0 additions and 22 deletions

View File

@ -18,8 +18,6 @@ try {
} }
``` ```
!SUBSUBSECTION Description
Thrown by the session storage's `delete` and `get` methods if passed a session ID that does not exist in the database. Thrown by the session storage's `delete` and `get` methods if passed a session ID that does not exist in the database.
!SUBSECTION Session Expired !SUBSECTION Session Expired
@ -33,8 +31,6 @@ try {
} }
``` ```
!SUBSUBSECTION Description
Thrown by the session storage's `get` method if passed a session ID for a session that has expired. See also this app's configuration options. Thrown by the session storage's `get` method if passed a session ID for a session that has expired. See also this app's configuration options.
!SECTION Create a session !SECTION Create a session
@ -44,8 +40,6 @@ var session = sessionStorage.create(sessionData);
assertEqual(session.get('sessionData'), sessionData); assertEqual(session.get('sessionData'), sessionData);
``` ```
!SUBSECTION Description
A session can be created by using the session storage's `create` method. The method optionally takes an object that will be stored as the session's `sessionData` attribute. The created session will be saved automatically with its initial data. A session can be created by using the session storage's `create` method. The method optionally takes an object that will be stored as the session's `sessionData` attribute. The created session will be saved automatically with its initial data.
!SECTION Fetch an existing session !SECTION Fetch an existing session
@ -61,8 +55,6 @@ There are two ways to fetch a session via the session storage API:
var session = sessionStorage.fromCookie(request, cookieName, secret); var session = sessionStorage.fromCookie(request, cookieName, secret);
``` ```
!SUBSUBSECTION Description
The method `fromCookie` will attempt to parse the given request's session cookie and return a session with the matching session ID. The method `fromCookie` will attempt to parse the given request's session cookie and return a session with the matching session ID.
Optionally, a `secret` string can be passed which will be used to verify the cookie's signature (see `addCookie` below). Optionally, a `secret` string can be passed which will be used to verify the cookie's signature (see `addCookie` below).
@ -81,8 +73,6 @@ The method will return `null` instead of a session object in the following cases
var session = sessionStorage.get(sessionId); var session = sessionStorage.get(sessionId);
``` ```
!SUBSUBSECTION Description
The method `get` will attempt to load the session with the given session ID from the database. If the session does not exist, a `SessionNotFound` exception will be thrown. If the session does exist, but has already expired, a `SessionExpired` exception will be thrown instead. The method `get` will attempt to load the session with the given session ID from the database. If the session does not exist, a `SessionNotFound` exception will be thrown. If the session does exist, but has already expired, a `SessionExpired` exception will be thrown instead.
!SECTION Delete a session !SECTION Delete a session
@ -98,8 +88,6 @@ There are two ways to delete a session from the database:
sessionStorage.delete(sessionId); sessionStorage.delete(sessionId);
``` ```
!SUBSUBSECTION Description
The method `delete` will attempt to delete the session with the given session ID from the database. If the session does not exist, a `SessionNotFound` exception will be thrown. The method always returns `null`. The method `delete` will attempt to delete the session with the given session ID from the database. If the session does not exist, a `SessionNotFound` exception will be thrown. The method always returns `null`.
!SUBSECTION Tell a session to delete itself !SUBSECTION Tell a session to delete itself
@ -108,8 +96,6 @@ The method `delete` will attempt to delete the session with the given session ID
session.delete(); session.delete();
``` ```
!SUBSUBSECTION Description
The session's `delete` method will attempt to delete the session from the database. The session's `delete` method will attempt to delete the session from the database.
Returns `true` if the session was deleted successfully. Returns `true` if the session was deleted successfully.
@ -138,8 +124,6 @@ The session's active user's `userData` attribute or an empty object.
session.save(); session.save();
``` ```
!SUBSECTION Description
Saves the session to the database. If you made any changes to the session and are not using the sessions app via Foxx Authentication, you must call this method to commit the changes to the database. Saves the session to the database. If you made any changes to the session and are not using the sessions app via Foxx Authentication, you must call this method to commit the changes to the database.
!SECTION Set a session's active user !SECTION Set a session's active user
@ -150,8 +134,6 @@ assertEqual(session.get('uid'), user.get('_key'));
assertEqual(session.get('userData'), user.get('userData')); assertEqual(session.get('userData'), user.get('userData'));
``` ```
!SUBSECTION Description
The `setUser` method expects a Foxx model with a `userData` attribute and sets the session's `uid` attribute to the model's `_key` and the session's `userData` attribute to the model's `userData` attribute. The `setUser` method expects a Foxx model with a `userData` attribute and sets the session's `uid` attribute to the model's `_key` and the session's `userData` attribute to the model's `userData` attribute.
!SECTION Add a session cookie to a response !SECTION Add a session cookie to a response
@ -160,8 +142,6 @@ The `setUser` method expects a Foxx model with a `userData` attribute and sets t
session.addCookie(response, cookieName, secret); session.addCookie(response, cookieName, secret);
``` ```
!SUBSECTION Description
The `addCookie` method adds a session cookie to the response. The `addCookie` method adds a session cookie to the response.
If a `secret` string is provided, the cookie is signed using that secret (a second cookie with the name `cookieName + '_sig'` containing the cryptographic signature of the cookie value is added to the response). If a `secret` string is provided, the cookie is signed using that secret (a second cookie with the name `cookieName + '_sig'` containing the cryptographic signature of the cookie value is added to the response).
@ -174,8 +154,6 @@ If you want to use signed cookies, you must make sure to pass the same `secret`
session.clearCookie(response, cookieName, secret); session.clearCookie(response, cookieName, secret);
``` ```
!SUBSECTION Description
The `clearCookie` method adds a blank expired cookie to clear the user's previously set session cookie. The `clearCookie` method adds a blank expired cookie to clear the user's previously set session cookie.
If the method is passed a `secret` string, a second blank expired cookie is added that overwrites the signature cookie (see above). If the method is passed a `secret` string, a second blank expired cookie is added that overwrites the signature cookie (see above).