Datastore sessions

This module requires you to add the ndb package to your app. See NDB.

class webapp2_extras.appengine.sessions_ndb.DatastoreSessionFactory(name, session_store)[source]

A session factory that stores data serialized in datastore.

To use datastore sessions, pass this class as the factory keyword to webapp2_extras.sessions.SessionStore.get_session():

from webapp2_extras import sessions_ndb

# [...]

session = self.session_store.get_session(
    name='db_session', factory=sessions_ndb.DatastoreSessionFactory)

See in webapp2_extras.sessions.SessionStore() an example of how to make sessions available in a webapp2.RequestHandler.


The session model class.

Previous topic

Memcache sessions

Next topic

User Models

This Page