def setSession(request):
msg=''
try:
request.session['userName']='lushijie'
msg='成功设置Session'
except Exception:
msg='设置Session失败'
return HttpResponse(msg)
def getSession(request):
msg=''
try:
msg=request.session['userName']
except Exception:
msg='没有设置session'
return HttpResponse(msg);
def delSession(request):
msg=''
try:
del request.session['userName']
msg='成功删除Session'
except Exception:
msg='删除Session失败'
return HttpResponse(msg)
msg=''
try:
request.session['userName']='lushijie'
msg='成功设置Session'
except Exception:
msg='设置Session失败'
return HttpResponse(msg)
def getSession(request):
msg=''
try:
msg=request.session['userName']
except Exception:
msg='没有设置session'
return HttpResponse(msg);
def delSession(request):
msg=''
try:
del request.session['userName']
msg='成功删除Session'
except Exception:
msg='删除Session失败'
return HttpResponse(msg)