set session from getrequest django code example
Example 1: django set session variable
request.session['idempresa'] = idempresaValue
Example 2: how to get data from django session
######### Store the data ############
request.session['idempresa'] = profile.idempresa
######## now use the data ################
if 'idempresa' in request.session:
idempresa = request.session['idempresa']