django之Session、Cookie
Session
·Session存在于服务器端
·Session的设置:
request.session['name'] = value
·Session的获取:
dic = request.session.get('name',None)
·Session的销毁
del request.session['name']
Cookie
设置
response.set_cookie('key','value')
获取
request.COOKIES