######### Store the data ############ request.session['idempresa'] = profile.idempresa ######## now use the data ################ if 'idempresa' in request.session: idempresa = request.session['idempresa']