We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
302 Status in Shipping Method. 
**TD;LR** When I enter the "Shipping Address" entire as anonymous or create a new address. It makes me submit it again and again.

Using c79bdbb13c399b253e3a26480d01f1cb219b4700

I get this most annoying bug. I can't solve from days. It only happens in the production site, not on the test as well as development. I really don't understand where I am going wrong.

What should really happen `Shipping Address(302) -> Shipping Method(200)`

Problem:
`Shipping Address(302) -> Shipping Method(302) -> Shipping Address(200)`.
This mean the users has to submit the form again and again.

Cases when `Shipping Method(200)` 
- 3 to 5 attempts of submitting the form.
- 2 to 5 minutes of waiting to submit again.

I have even done an attempt using the `old checkout`, when the billing address was the first form, Still result is the same.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `saleor/core/__init__.py`
Content:
```
1 from __future__ import unicode_literals
2 
3 from babel.numbers import get_territory_currencies
4 from django.conf import settings
5 from django_countries import countries
6 from django_countries.fields import Country
7 from geolite2 import geolite2
8 
9 TOKEN_PATTERN = ('(?P<token>[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}'
10                  '-[0-9a-z]{12})')
11 
12 
13 def get_country_by_ip(ip_address):
14     reader = geolite2.reader()
15     geo_data = reader.get(ip_address)
16     geolite2.close()
17     if geo_data and 'country' in geo_data and 'iso_code' in geo_data['country']:
18         country_iso_code = geo_data['country']['iso_code']
19         if country_iso_code in countries:
20             return Country(country_iso_code)
21 
22 
23 def get_currency_for_country(country):
24     currencies = get_territory_currencies(country.code)
25     if len(currencies):
26         main_currency = currencies[0]
27         if main_currency in settings.AVAILABLE_CURRENCIES:
28             return main_currency
29     return settings.DEFAULT_CURRENCY
30
```
--- 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()

```

diff --git a/saleor/core/__init__.py b/saleor/core/__init__.py
--- a/saleor/core/__init__.py
+++ b/saleor/core/__init__.py
@@ -2,6 +2,7 @@
 
 from babel.numbers import get_territory_currencies
 from django.conf import settings
+from django.core.checks import register, Tags, Warning
 from django_countries import countries
 from django_countries.fields import Country
 from geolite2 import geolite2
@@ -27,3 +28,19 @@
         if main_currency in settings.AVAILABLE_CURRENCIES:
             return main_currency
     return settings.DEFAULT_CURRENCY
+
+
+@register()
+def check_session_caching(app_configs, **kwargs):
+    errors = []
+    cached_engines = {
+        'django.contrib.sessions.backends.cache',
+        'django.contrib.sessions.backends.cached_db'}
+    if ('locmem' in settings.CACHES['default']['BACKEND'] and
+            settings.SESSION_ENGINE in cached_engines):
+        errors.append(
+            Warning(
+                'Session caching cannot work with locmem backend',
+                'User sessions need to be globally shared, use a cache server like Redis.',
+                'saleor.W001'))
+    return errors

{"golden_diff": "diff --git a/saleor/core/__init__.py b/saleor/core/__init__.py\n--- a/saleor/core/__init__.py\n+++ b/saleor/core/__init__.py\n@@ -2,6 +2,7 @@\n \n from babel.numbers import get_territory_currencies\n from django.conf import settings\n+from django.core.checks import register, Tags, Warning\n from django_countries import countries\n from django_countries.fields import Country\n from geolite2 import geolite2\n@@ -27,3 +28,19 @@\n         if main_currency in settings.AVAILABLE_CURRENCIES:\n             return main_currency\n     return settings.DEFAULT_CURRENCY\n+\n+\n+@register()\n+def check_session_caching(app_configs, **kwargs):\n+    errors = []\n+    cached_engines = {\n+        'django.contrib.sessions.backends.cache',\n+        'django.contrib.sessions.backends.cached_db'}\n+    if ('locmem' in settings.CACHES['default']['BACKEND'] and\n+            settings.SESSION_ENGINE in cached_engines):\n+        errors.append(\n+            Warning(\n+                'Session caching cannot work with locmem backend',\n+                'User sessions need to be globally shared, use a cache server like Redis.',\n+                'saleor.W001'))\n+    return errors\n", "issue": "302 Status in Shipping Method. \n**TD;LR** When I enter the \"Shipping Address\" entire as anonymous or create a new address. It makes me submit it again and again.\n\nUsing c79bdbb13c399b253e3a26480d01f1cb219b4700\n\nI get this most annoying bug. I can't solve from days. It only happens in the production site, not on the test as well as development. I really don't understand where I am going wrong.\n\nWhat should really happen `Shipping Address(302) -> Shipping Method(200)`\n\nProblem:\n`Shipping Address(302) -> Shipping Method(302) -> Shipping Address(200)`.\nThis mean the users has to submit the form again and again.\n\nCases when `Shipping Method(200)` \n- 3 to 5 attempts of submitting the form.\n- 2 to 5 minutes of waiting to submit again.\n\nI have even done an attempt using the `old checkout`, when the billing address was the first form, Still result is the same.\n\n", "before_files": [{"content": "from __future__ import unicode_literals\n\nfrom babel.numbers import get_territory_currencies\nfrom django.conf import settings\nfrom django_countries import countries\nfrom django_countries.fields import Country\nfrom geolite2 import geolite2\n\nTOKEN_PATTERN = ('(?P<token>[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}'\n                 '-[0-9a-z]{12})')\n\n\ndef get_country_by_ip(ip_address):\n    reader = geolite2.reader()\n    geo_data = reader.get(ip_address)\n    geolite2.close()\n    if geo_data and 'country' in geo_data and 'iso_code' in geo_data['country']:\n        country_iso_code = geo_data['country']['iso_code']\n        if country_iso_code in countries:\n            return Country(country_iso_code)\n\n\ndef get_currency_for_country(country):\n    currencies = get_territory_currencies(country.code)\n    if len(currencies):\n        main_currency = currencies[0]\n        if main_currency in settings.AVAILABLE_CURRENCIES:\n            return main_currency\n    return settings.DEFAULT_CURRENCY\n", "path": "saleor/core/__init__.py"}], "after_files": [{"content": "from __future__ import unicode_literals\n\nfrom babel.numbers import get_territory_currencies\nfrom django.conf import settings\nfrom django.core.checks import register, Tags, Warning\nfrom django_countries import countries\nfrom django_countries.fields import Country\nfrom geolite2 import geolite2\n\nTOKEN_PATTERN = ('(?P<token>[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}'\n                 '-[0-9a-z]{12})')\n\n\ndef get_country_by_ip(ip_address):\n    reader = geolite2.reader()\n    geo_data = reader.get(ip_address)\n    geolite2.close()\n    if geo_data and 'country' in geo_data and 'iso_code' in geo_data['country']:\n        country_iso_code = geo_data['country']['iso_code']\n        if country_iso_code in countries:\n            return Country(country_iso_code)\n\n\ndef get_currency_for_country(country):\n    currencies = get_territory_currencies(country.code)\n    if len(currencies):\n        main_currency = currencies[0]\n        if main_currency in settings.AVAILABLE_CURRENCIES:\n            return main_currency\n    return settings.DEFAULT_CURRENCY\n\n\n@register()\ndef check_session_caching(app_configs, **kwargs):\n    errors = []\n    cached_engines = {\n        'django.contrib.sessions.backends.cache',\n        'django.contrib.sessions.backends.cached_db'}\n    if ('locmem' in settings.CACHES['default']['BACKEND'] and\n            settings.SESSION_ENGINE in cached_engines):\n        errors.append(\n            Warning(\n                'Session caching cannot work with locmem backend',\n                'User sessions need to be globally shared, use a cache server like Redis.',\n                'saleor.W001'))\n    return errors\n", "path": "saleor/core/__init__.py"}]}