﻿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
23596	request.session.save() raise TypeError: [<Group: Admin user>] is not JSON serializable	Cao T	nobody	"request.session.save() raise TypeError: [<Group: Admin user>] is not JSON serializable

it's the auth.models.Group.objects.all() that is not JSON serializable. it worked perfect well upto django 1.5.

Django 1.5:

{{{
    def encode(self, session_dict):
        ""Returns the given session dictionary pickled and encoded as a string.""
        pickled = pickle.dumps(session_dict, pickle.HIGHEST_PROTOCOL)
        hash = self._hash(pickled)
        return base64.b64encode(hash.encode() + b"":"" + pickled).decode('ascii')
}}}

Django 1.7:


{{{
    def encode(self, session_dict):
        ""Returns the given session dictionary serialized and encoded as a string.""
        serialized = self.serializer().dumps(session_dict)
        hash = self._hash(serialized)
        return base64.b64encode(hash.encode() + b"":"" + serialized).decode('ascii')
}}}


it looks there is some issue with self.serializer().
"	Bug	closed	contrib.sessions	1.7	Normal	invalid	session save serializer dumps JSON serializable		Unreviewed	0	0	0	0	0	1
