forked from rDrama/rDrama
fix duplicate cookie issue
parent
072010ff8a
commit
c1d7b9acc2
|
@ -68,6 +68,13 @@ def after_request(response:Response):
|
||||||
if user_id:
|
if user_id:
|
||||||
redis_instance.delete(f'LIMITER/{SITE}-{user_id}/{request.endpoint}:{request.path}/1/1/second')
|
redis_instance.delete(f'LIMITER/{SITE}-{user_id}/{request.endpoint}:{request.path}/1/1/second')
|
||||||
|
|
||||||
|
cookie_name = app.config["SESSION_COOKIE_NAME"]
|
||||||
|
if len(request.cookies.getlist(cookie_name)) > 1:
|
||||||
|
response.set_cookie(cookie_name, 'test', max_age=0, domain=f".{SITE}")
|
||||||
|
response.set_cookie(cookie_name, 'test', max_age=0)
|
||||||
|
session.clear()
|
||||||
|
print(f"{STARS}Cleared {user_id}'s cookies successfully!{STARS}", flush=True)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue