mysql - I set a key in django's request.session , but has no effect -
i set jobfile key in session below:
def getjoblist(request): joblist = request.get.get('job') jobliststr = joblist[0:-1] request.session['jobfile'] = jobliststr return httpresponse("ok\n")
and check mysql database, rows increment, when test key ,it shows key not in session:
if request.session.has_key('jobfile'): # return false;
i didn't know why?
you may need save session after adding new key
request.session['jobfile'] request.session.save()
Comments
Post a Comment