I'm beginner of web. Now I'm studing session and cookie using django.
MY first question is
when client(a) connect to server first time, server give client cookie and sever save that in session. Then, when the same client connects to the server again after the connection between the client and the server ends, then sever give different cookie to user and save different session??
below is my code.
def cookie(request):
print(request.COOKIES)
resp = HttpResponse('C is for cookie and that is good enough for me...')
resp.set_cookie('zap', 42) # No expired date = until browser close
resp.set_cookie('sakaicar', 42, max_age=1000) # seconds until expire
return resp
In these codes, the end of the session is different. If one of the two sessions ends, The other one is saved as it is, right? Oh and if I do set.cookie, will it be saved as a session on the server?