django provides full support for anonymous sessions the session framework lets you store and retrieve arbitrary data on a persitevisitor basis it stores data on the server side and abstracts the sending and receiving of cookies cookies contain a session id not the data itself the django sessions framework is entirely cookiebased it does not fall back to putting session ids in urls this is an intentional design decision not only does that behavior make urls ugly it makes your site vulnerable to sessionid theft via the referer header for complete documentation on using sessions in your code consult the sessions documentation that is shipped with django also available on the django web site django provides full support for anonymous sessions the session framework lets you store and retrieve arbitrary data on a per site visitor basis it stores data on the server side and abstracts the sending and receiving of cookies cookies contain a session id not the data itself the django sessions framework is entirely cookie based it does not fall back to putting session ids in urls this is an intentional design decision not only does that behavior make urls ugly it makes your site vulnerable to session id theft via the referer header for complete documentation on using sessions in your code consult the sessions documentation that is shipped with django also available on the django web site
from django.contrib.sessions.base_session import AbstractBaseSession, BaseSessionManager


class SessionManager(BaseSessionManager):
    use_in_migrations = True


class Session(AbstractBaseSession):
    

    objects = SessionManager()

    @classmethod
    def get_session_store_class(cls):
        from django.contrib.sessions.backends.db import SessionStore

        return SessionStore

    class Meta(AbstractBaseSession.Meta):
        db_table = "django_session"