To set browser cookies in Django that automatically expire in the specified time, use the following snippet:
1.
d
=
datetime.datetime.now()
+
datetime.timedelta(days
=
1
)
2.
response.set_cookie(
'something'
, value
=
50
, expires
=
d.strftime(
"%a, %d-%b-%Y %H:%M:%S GMT"
))