prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Fix cookies for Utnarm
  Utnarm recently switched to utnarm.se instead of utnarm.utn.se. This lead to that you can’t sign in to utnarm.se. Per default, moore uses utn.se as cookie domain and since utnarm.se is a different top level domain the cookies can’t be used. 
  
  We need to dynamically add utnarm.se as a cookie domain. This python package might be useful https://github.com/ViktorStiskala/django-shared-session
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/moore/settings/production.py`
  Content:
  ```
  1 """
  2 Django settings for the production environment of Project Moore.
  3 
  4 For more information regarding running in production see,
  5 See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
  6 
  7 For more information on this file, see
  8 https://docs.djangoproject.com/en/1.10/topics/settings/
  9 
  10 For the full list of settings and their values, see
  11 https://docs.djangoproject.com/en/1.10/ref/settings/
  12 """
  13 from __future__ import absolute_import, unicode_literals
  14 import raven
  15 
  16 from .base import *
  17 
  18 # SECURITY WARNING: don't run with debug turned on in production!
  19 DEBUG = False
  20 
  21 # SECURITY WARNING: keep the secret key used in production secret!
  22 SECRET_KEY = os.environ.get(
  23     'DJANGO_SECRET',
  24     'za7^0@54n&p-dg4)_l12q_3^o5awz_uym0osqaz2!myki_8kw0'
  25 )
  26 
  27 # Database
  28 # https://docs.djangoproject.com/en/1.10/ref/settings/#databases
  29 
  30 DATABASES = {
  31     'default': {
  32         'ENGINE': 'django.db.backends.postgresql',
  33         'NAME': os.environ.get('DJANGO_DB_NAME', 'moore'),
  34         'USER': os.environ.get('DJANGO_DB_USER', 'moore'),
  35         'PASSWORD': os.environ.get('DJANGO_DB_PASS'),
  36         'HOST': os.environ.get('DJANGO_DB_HOST', '127.0.0.1'),
  37         'PORT':  os.environ.get('DJANGO_DB_PORT', '5432'),
  38     }
  39 }
  40 
  41 
  42 # CONN_MAX_AGE = 0
  43 
  44 # Base URL to use when referring to full URLs within the Wagtail admin
  45 # backend - e.g. in notification emails. Don't include '/admin' or a
  46 # trailing slash
  47 BASE_URL = 'https://utn.se'
  48 
  49 ALLOWED_HOSTS = ['.utn.se', '.utnarm.se']
  50 
  51 # Email settings
  52 DEFAULT_FROM_EMAIL = 'info@utn.se'
  53 
  54 EMAIL_SUBJECT_PREFIX = '[UTN] '
  55 
  56 # Sentry Configuration - will be sent error messages
  57 RAVEN_CONFIG = {
  58     'dsn': os.environ.get('SENTRY_DSN'),
  59     'release': raven.fetch_git_sha(os.path.dirname(BASE_DIR)),
  60 }
  61 
  62 LOGGING = {
  63     'version': 1,
  64     'disable_existing_loggers': True,
  65     'root': {
  66         'level': 'WARNING',
  67         'handlers': ['sentry'],
  68     },
  69     'formatters': {
  70         'verbose': {
  71             'format': '%(levelname)s %(asctime)s %(module)s '
  72                       '%(process)d %(thread)d %(message)s'
  73         },
  74     },
  75     'handlers': {
  76         'sentry': {
  77             'level': 'ERROR',
  78             'class': 'raven.contrib.django.raven_compat'
  79                      '.handlers.SentryHandler',
  80             'tags': {'custom-tag': 'x'},
  81         },
  82         'console': {
  83             'level': 'DEBUG',
  84             'class': 'logging.StreamHandler',
  85             'formatter': 'verbose'
  86         }
  87     },
  88     'loggers': {
  89         'django.db.backends': {
  90             'level': 'ERROR',
  91             'handlers': ['console'],
  92             'propagate': False,
  93         },
  94         'raven': {
  95             'level': 'DEBUG',
  96             'handlers': ['console'],
  97             'propagate': False,
  98         },
  99         'sentry.errors': {
  100             'level': 'DEBUG',
  101             'handlers': ['console'],
  102             'propagate': False,
  103         },
  104     },
  105 }
  106 
  107 CSRF_COOKIE_SECURE = True
  108 
  109 SESSION_COOKIE_DOMAIN = '.utn.se'
  110 
  111 SESSION_COOKIE_SECURE = True
  112 
  113 MELOS_URL = os.environ.get('MELOS_URL')
  114 MELOS_ORG_ID = os.environ.get('MELOS_ORG_ID')
  115 MELOS_ADMIN = os.environ.get('MELOS_ADMIN')
  116 
  117 # Google API
  118 GOOGLE_API_KEY = os.environ.get('GOOGLE_API_KEY')
  119 
  120 RECAPTCHA_PUBLIC_KEY = os.environ.get("RECAPTCHA_PUBLIC_KEY", "")
  121 RECAPTCHA_PRIVATE_KEY = os.environ.get("RECAPTCHA_PRIVATE_KEY", "")
  122 
  123 try:
  124     from .local import *
  125 except ImportError:
  126     pass
  127
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/src/moore/settings/production.py b/src/moore/settings/production.py
  --- a/src/moore/settings/production.py
  +++ b/src/moore/settings/production.py
  @@ -106,8 +106,6 @@
   
   CSRF_COOKIE_SECURE = True
   
  -SESSION_COOKIE_DOMAIN = '.utn.se'
  -
   SESSION_COOKIE_SECURE = True
   
   MELOS_URL = os.environ.get('MELOS_URL')
  
verification_info: {"golden_diff": "diff --git a/src/moore/settings/production.py b/src/moore/settings/production.py\n--- a/src/moore/settings/production.py\n+++ b/src/moore/settings/production.py\n@@ -106,8 +106,6 @@\n \n CSRF_COOKIE_SECURE = True\n \n-SESSION_COOKIE_DOMAIN = '.utn.se'\n-\n SESSION_COOKIE_SECURE = True\n \n MELOS_URL = os.environ.get('MELOS_URL')\n", "issue": "Fix cookies for Utnarm\nUtnarm recently switched to utnarm.se instead of utnarm.utn.se. This lead to that you can\u2019t sign in to utnarm.se. Per default, moore uses utn.se as cookie domain and since utnarm.se is a different top level domain the cookies can\u2019t be used. \r\n\r\nWe need to dynamically add utnarm.se as a cookie domain. This python package might be useful https://github.com/ViktorStiskala/django-shared-session\n", "before_files": [{"content": "\"\"\"\nDjango settings for the production environment of Project Moore.\n\nFor more information regarding running in production see,\nSee https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.10/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.10/ref/settings/\n\"\"\"\nfrom __future__ import absolute_import, unicode_literals\nimport raven\n\nfrom .base import *\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = False\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = os.environ.get(\n    'DJANGO_SECRET',\n    'za7^0@54n&p-dg4)_l12q_3^o5awz_uym0osqaz2!myki_8kw0'\n)\n\n# Database\n# https://docs.djangoproject.com/en/1.10/ref/settings/#databases\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.postgresql',\n        'NAME': os.environ.get('DJANGO_DB_NAME', 'moore'),\n        'USER': os.environ.get('DJANGO_DB_USER', 'moore'),\n        'PASSWORD': os.environ.get('DJANGO_DB_PASS'),\n        'HOST': os.environ.get('DJANGO_DB_HOST', '127.0.0.1'),\n        'PORT':  os.environ.get('DJANGO_DB_PORT', '5432'),\n    }\n}\n\n\n# CONN_MAX_AGE = 0\n\n# Base URL to use when referring to full URLs within the Wagtail admin\n# backend - e.g. in notification emails. Don't include '/admin' or a\n# trailing slash\nBASE_URL = 'https://utn.se'\n\nALLOWED_HOSTS = ['.utn.se', '.utnarm.se']\n\n# Email settings\nDEFAULT_FROM_EMAIL = 'info@utn.se'\n\nEMAIL_SUBJECT_PREFIX = '[UTN] '\n\n# Sentry Configuration - will be sent error messages\nRAVEN_CONFIG = {\n    'dsn': os.environ.get('SENTRY_DSN'),\n    'release': raven.fetch_git_sha(os.path.dirname(BASE_DIR)),\n}\n\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': True,\n    'root': {\n        'level': 'WARNING',\n        'handlers': ['sentry'],\n    },\n    'formatters': {\n        'verbose': {\n            'format': '%(levelname)s %(asctime)s %(module)s '\n                      '%(process)d %(thread)d %(message)s'\n        },\n    },\n    'handlers': {\n        'sentry': {\n            'level': 'ERROR',\n            'class': 'raven.contrib.django.raven_compat'\n                     '.handlers.SentryHandler',\n            'tags': {'custom-tag': 'x'},\n        },\n        'console': {\n            'level': 'DEBUG',\n            'class': 'logging.StreamHandler',\n            'formatter': 'verbose'\n        }\n    },\n    'loggers': {\n        'django.db.backends': {\n            'level': 'ERROR',\n            'handlers': ['console'],\n            'propagate': False,\n        },\n        'raven': {\n            'level': 'DEBUG',\n            'handlers': ['console'],\n            'propagate': False,\n        },\n        'sentry.errors': {\n            'level': 'DEBUG',\n            'handlers': ['console'],\n            'propagate': False,\n        },\n    },\n}\n\nCSRF_COOKIE_SECURE = True\n\nSESSION_COOKIE_DOMAIN = '.utn.se'\n\nSESSION_COOKIE_SECURE = True\n\nMELOS_URL = os.environ.get('MELOS_URL')\nMELOS_ORG_ID = os.environ.get('MELOS_ORG_ID')\nMELOS_ADMIN = os.environ.get('MELOS_ADMIN')\n\n# Google API\nGOOGLE_API_KEY = os.environ.get('GOOGLE_API_KEY')\n\nRECAPTCHA_PUBLIC_KEY = os.environ.get(\"RECAPTCHA_PUBLIC_KEY\", \"\")\nRECAPTCHA_PRIVATE_KEY = os.environ.get(\"RECAPTCHA_PRIVATE_KEY\", \"\")\n\ntry:\n    from .local import *\nexcept ImportError:\n    pass\n", "path": "src/moore/settings/production.py"}], "after_files": [{"content": "\"\"\"\nDjango settings for the production environment of Project Moore.\n\nFor more information regarding running in production see,\nSee https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.10/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.10/ref/settings/\n\"\"\"\nfrom __future__ import absolute_import, unicode_literals\nimport raven\n\nfrom .base import *\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = False\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = os.environ.get(\n    'DJANGO_SECRET',\n    'za7^0@54n&p-dg4)_l12q_3^o5awz_uym0osqaz2!myki_8kw0'\n)\n\n# Database\n# https://docs.djangoproject.com/en/1.10/ref/settings/#databases\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.postgresql',\n        'NAME': os.environ.get('DJANGO_DB_NAME', 'moore'),\n        'USER': os.environ.get('DJANGO_DB_USER', 'moore'),\n        'PASSWORD': os.environ.get('DJANGO_DB_PASS'),\n        'HOST': os.environ.get('DJANGO_DB_HOST', '127.0.0.1'),\n        'PORT':  os.environ.get('DJANGO_DB_PORT', '5432'),\n    }\n}\n\n\n# CONN_MAX_AGE = 0\n\n# Base URL to use when referring to full URLs within the Wagtail admin\n# backend - e.g. in notification emails. Don't include '/admin' or a\n# trailing slash\nBASE_URL = 'https://utn.se'\n\nALLOWED_HOSTS = ['.utn.se', '.utnarm.se']\n\n# Email settings\nDEFAULT_FROM_EMAIL = 'info@utn.se'\n\nEMAIL_SUBJECT_PREFIX = '[UTN] '\n\n# Sentry Configuration - will be sent error messages\nRAVEN_CONFIG = {\n    'dsn': os.environ.get('SENTRY_DSN'),\n    'release': raven.fetch_git_sha(os.path.dirname(BASE_DIR)),\n}\n\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': True,\n    'root': {\n        'level': 'WARNING',\n        'handlers': ['sentry'],\n    },\n    'formatters': {\n        'verbose': {\n            'format': '%(levelname)s %(asctime)s %(module)s '\n                      '%(process)d %(thread)d %(message)s'\n        },\n    },\n    'handlers': {\n        'sentry': {\n            'level': 'ERROR',\n            'class': 'raven.contrib.django.raven_compat'\n                     '.handlers.SentryHandler',\n            'tags': {'custom-tag': 'x'},\n        },\n        'console': {\n            'level': 'DEBUG',\n            'class': 'logging.StreamHandler',\n            'formatter': 'verbose'\n        }\n    },\n    'loggers': {\n        'django.db.backends': {\n            'level': 'ERROR',\n            'handlers': ['console'],\n            'propagate': False,\n        },\n        'raven': {\n            'level': 'DEBUG',\n            'handlers': ['console'],\n            'propagate': False,\n        },\n        'sentry.errors': {\n            'level': 'DEBUG',\n            'handlers': ['console'],\n            'propagate': False,\n        },\n    },\n}\n\nCSRF_COOKIE_SECURE = True\n\nSESSION_COOKIE_SECURE = True\n\nMELOS_URL = os.environ.get('MELOS_URL')\nMELOS_ORG_ID = os.environ.get('MELOS_ORG_ID')\nMELOS_ADMIN = os.environ.get('MELOS_ADMIN')\n\n# Google API\nGOOGLE_API_KEY = os.environ.get('GOOGLE_API_KEY')\n\nRECAPTCHA_PUBLIC_KEY = os.environ.get(\"RECAPTCHA_PUBLIC_KEY\", \"\")\nRECAPTCHA_PRIVATE_KEY = os.environ.get(\"RECAPTCHA_PRIVATE_KEY\", \"\")\n\ntry:\n    from .local import *\nexcept ImportError:\n    pass\n", "path": "src/moore/settings/production.py"}]}