Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
b3f038ab
Commit
b3f038ab
authored
Nov 05, 2001
by
matt@zope.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Session documentation
parent
a4c46fd9
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
815 additions
and
1265 deletions
+815
-1265
lib/python/Products/Sessions/help/SessionInterfaces.py
lib/python/Products/Sessions/help/SessionInterfaces.py
+158
-0
lib/python/Products/Sessions/help/Sessions.stx
lib/python/Products/Sessions/help/Sessions.stx
+41
-1265
lib/python/Products/Sessions/help/session-admin.stx
lib/python/Products/Sessions/help/session-admin.stx
+245
-0
lib/python/Products/Sessions/help/sessionapi-prog.stx
lib/python/Products/Sessions/help/sessionapi-prog.stx
+371
-0
No files found.
lib/python/Products/Sessions/help/SessionInterfaces.py
0 → 100644
View file @
b3f038ab
"""
Session API
See Also
- "Programming with the Session API":sessionapi-prog.stx
- "Transient Object API":../../Transience/Help/TransienceInterfaces.py
"""
import
Interface
class
BrowserIdManagerInterface
(
Interface
.
Base
):
"""
Zope Browser Id Manager interface.
A Zope Browser Id Manager is responsible for assigning ids to site
visitors, and for servicing requests from Session Data Managers
related to the browser token.
"""
def
encodeUrl
(
self
,
url
):
"""
Encodes a provided URL with the current request's browser token
and returns the result. For example, the call
encodeUrl('http://foo.com/amethod') might return
'http://foo.com/amethod?_ZopeId=as9dfu0adfu0ad'.
Permission required: Access contents information
Raises: BrowserIdManagerErr. If there is no current session token.
"""
def
getTokenKey
(
self
):
"""
Returns a string with the name of the cookie/form variable which is
used by the current browser id manager as the name to look up when
attempting to obtain the browser token value. For example, '_ZopeId'.
Permission required: Access contents information
"""
def
getToken
(
self
,
create
=
1
):
"""
If create=0, returns a the current browser token or None if there
is no browser token associated with the current request. If create=1,
returns the current browser token or a newly-created browser token if
there is no browser token associated with the current request. This
method is useful in conjunction with getTokenKey if you wish to embed
the token-key/token combination as a hidden value in a POST-based
form. The browser token is opaque, has no business meaning, and its
length, type, and composition are subject to change.
Permission required: Access contents information
Raises: BrowserIdManagerErr. If ill-formed browser token
is found in REQUEST.
"""
def
hasToken
(
self
):
"""
Returns true if there is a browser token for this request.
Permission required: Access contents information
"""
def
isTokenNew
(
self
):
"""
Returns true if browser token is 'new'. A browser token is 'new'
when it is first created and the client has therefore not sent it
back to the server in any request.
Permission required: Access contents information
Raises: BrowserIdManagerErr. If there is no current browser token.
"""
def
isTokenFromForm
(
self
):
"""
Returns true if browser token comes from a form variable (query
string or post).
Permission required: Access contents information
Raises: BrowserIdManagerErr. If there is no current browser token.
"""
def
isTokenFromCookie
(
self
):
"""
Returns true if browser token comes from a cookie.
Permission required: Access contents information
Raises: BrowserIdManagerErr. If there is no current browser token.
"""
def
flushTokenCookie
(
self
):
"""
Deletes the token cookie from the client browser, iff the
'cookies' token key namespace is being used.
Permission required: Access contents information
Raises: BrowserIdManagerErr. If the 'cookies' namespace isn't
a token key namespace at the time of the call.
"""
class
SessionDataManagerInterface
(
Interface
.
Base
):
"""
Zope Session Data Manager interface.
A Zope Session Data Manager is responsible for maintaining Session
Data Objects, and for servicing requests from application code
related to Session Data Objects. It also communicates with a Browser
Id Manager to provide information about browser tokens.
"""
def
getBrowserIdManager
(
self
):
"""
Returns the nearest acquirable browser id manager.
Raises SessionDataManagerErr if no browser id manager can be found.
Permission required: Access session data
"""
def
getSessionData
(
self
,
create
=
1
):
"""
Returns a Session Data Object associated with the current
browser token. If there is no current token, and create is true,
returns a new Session Data Object. If there is no current
token and create is false, returns None.
Permission required: Access session data
"""
def
hasSessionData
(
self
):
"""
Returns true if a Session Data Object associated with the
current browser token is found in the Session Data Container. Does
not create a Session Data Object if one does not exist.
Permission required: Access session data
"""
def
getSessionDataByKey
(
self
,
key
):
"""
Returns a Session Data Object associated with 'key'. If there is
no Session Data Object associated with 'key' return None.
Permission required: Access arbitrary user session data
"""
lib/python/Products/Sessions/help/Sessions.stx
View file @
b3f038ab
This diff is collapsed.
Click to expand it.
lib/python/Products/Sessions/help/session-admin.stx
0 → 100644
View file @
b3f038ab
This diff is collapsed.
Click to expand it.
lib/python/Products/Sessions/help/sessionapi-prog.stx
0 → 100644
View file @
b3f038ab
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment