def session_identity_saver(identity): session['identity.id'] = identity.id session['identity.auth_type'] = identity.auth_type session.modified = True