SessionMixin
Expands a basic dictionary with session attributes.
Attributes
| Attribute | Type | Description |
|---|---|---|
| new | = False | Some implementations can detect whether a session is newly created, but that is not guaranteed. Use with caution. The mixin default is hard-coded "False". |
| modified | = True | Some implementations can detect changes to the session and set this when that happens. The mixin default is hard coded to "True". |
| accessed | = False | Indicates if the session was accessed, even if it was not modified. This is set when the session object is accessed through the request context, including the global :data:.session proxy. A Vary: cookie header will be added if this is True. |
Methods
permanent()
@classmethod
def permanent() - > bool
This reflects the "_permanent" key in the dict.
Returns
| Type | Description |
|---|---|
bool | The boolean value indicating if the session is permanent. |
permanent()
@classmethod
def permanent(
value: bool
) - > None
Sets the permanent status of the session by updating the "_permanent" key in the dictionary.
Parameters
| Name | Type | Description |
|---|---|---|
| value | bool | A boolean indicating whether the session should be permanent. This value is cast to a boolean. |
Returns
| Type | Description |
|---|---|
None | None |