Change cookie expires to max-age

This commit is contained in:
JonnyWong16 2023-12-07 23:05:34 -08:00
commit d0c07326ab
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -337,12 +337,12 @@ class AuthController(object):
jwt_cookie = str(JWT_COOKIE_NAME + plexpy.CONFIG.PMS_UUID) jwt_cookie = str(JWT_COOKIE_NAME + plexpy.CONFIG.PMS_UUID)
cherrypy.response.cookie[jwt_cookie] = '' cherrypy.response.cookie[jwt_cookie] = ''
cherrypy.response.cookie[jwt_cookie]['expires'] = 0 cherrypy.response.cookie[jwt_cookie]['max-age'] = 0
cherrypy.response.cookie[jwt_cookie]['path'] = plexpy.HTTP_ROOT.rstrip('/') or '/' cherrypy.response.cookie[jwt_cookie]['path'] = plexpy.HTTP_ROOT.rstrip('/') or '/'
if plexpy.HTTP_ROOT != '/': if plexpy.HTTP_ROOT != '/':
# Also expire the JWT on the root path # Also expire the JWT on the root path
cherrypy.response.headers['Set-Cookie'] = jwt_cookie + '=""; expires=Thu, 01 Jan 1970 12:00:00 GMT; path=/' cherrypy.response.headers['Set-Cookie'] = jwt_cookie + '=""; max-age=0; path=/'
cherrypy.request.login = None cherrypy.request.login = None