﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26831	Session serialisers should document limitations on values	Sasha Romijn	Md. Sadaf Noor	"The JSON session serialiser in Django (the default) does not allow non-UTF8 bytes to be stored in session values. This fact is not documented, although it may not be entirely surprising as Django expects utf-8 everywhere. However, for clarity it may still be better to mention this, probably under https://docs.djangoproject.com/en/dev/topics/http/sessions/#session-serialization

Here's a specific example of what you can't do, because '\xd9' is not valid unicode:
{{{
>>> from django.contrib.sessions.backends.db import SessionStore
>>> s = SessionStore()
>>> s['foo'] = '\xd9'
>>> s.save()
......
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd9 in position 0: unexpected end of data
}}}

I'm considering this a documentation bug, as according to my research there is no way to encode this non-utf8 data into JSON."	Cleanup/optimization	closed	Documentation	dev	Normal	fixed			Accepted	1	0	0	0	1	0
