django-cms / djangocms-history

Provides undo/redo functionality for django CMS operations
https://www.django-cms.org
Other
28 stars 13 forks source link

Session backends that generate session keys longer than 120 characters break content updates. #39

Open bckohan opened 3 years ago

bckohan commented 3 years ago

I came across this when attempting to use:

SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'

When a content edit is attempted this results in the following exception:

django.db.utils.DataError: value too long for type character varying(120)

Investigation showed the session key to be of length 300 which is clearly too large for:


# Django uses 40 character session keys but other backends might use longer..
user_session_key = models.CharField(max_length=120, db_index=True)