I am implementing a duplicate vote checking. I set a cookie in the vote view:
# Set duplicate vote cookie.
half_year = timedelta(weeks=26)
expires = datetime.utcnow() + half_year
if cookie and re.match(cookie_pattern, cookie):
redirect.set_cookie(cookie_name, "{}-{}".format(cookie, question.id), expires=expires)
else:
redirect.set_cookie(cookie_name, question.id, expires=expires)
Now I want to access the cookie and than set a context variable in a generic details view. Is this possible or do I have to write a not generic one?