标签:size count 表单 style end strong ons for html
会话的保持和form表单
cookie
1 from django.shortcuts import render, HttpResponse, redirect, reverse 2 3 4 def set_cookie(request): 5 num = request.COOKIES.get(‘num‘, 0) 6 num = str(int(num) + 1) 7 response = render(request, ‘crm/count.html‘, context={ 8 ‘num‘: num 9 }) 10 response.set_cookie(‘num‘, num, max_age=5) 11 return response
设置超时间为5秒
session
标签:size count 表单 style end strong ons for html
原文地址:https://www.cnblogs.com/ivy-blogs/p/10675288.html