Skip to content

Commit

Permalink
Set max age for picture like cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
gruy committed Jan 25, 2024
1 parent 290cade commit 1d1f5bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion djangocms_picture/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def post(self, request, *args, **kwargs):
response = JsonResponse({'result': result, 'like_id': like.id})

if 'uuid' in flt:
response.set_cookie(cookie_name, flt['uuid'])
max_age = 60 * 60 * 24 * 365 # 1 year
response.set_cookie(cookie_name, flt['uuid'], max_age=max_age)

return response

0 comments on commit 1d1f5bf

Please sign in to comment.