'Returns the given session dictionary pickled and encoded as a string.'

def encode(self, session_dict):

    pickled = pickle.dumps(session_dict)
    pickled_md5 = md5_constructor((pickled + settings.SECRET_KEY)).hexdigest()
    return base64.encodestring((pickled + pickled_md5))
