title: Flask app throwing pickle.load 500 error on login on Windows but not on Ubuntu
body: <p>I am new at coding and here and I tried googling, I can't resolve my issue, so please show a little patience and not excessive laconism. </p>
  
  <p>This error message is throwed at any redirect, and it is always the same, I can't track it for my life.</p>
  
  <p>I've created a Flask app using PyCharm named application.py. My problem happens on login on 127.0.0.1:5000 (redirection to index), and it throws a fairly cryptic error stack, but not a single message is directed at application.py, so I don't even know which code snippet to upload. Database is not the source of the issue, because I see that it is getting updated. This same program works on Ubuntu VM without a hiccup. I think this may be some kind of a system proxy issue, I have a site blocker called Freedom (freedom.to), but closing this app doesn't seem to fix the problem now (it used to though, I thought it was it, but now it is driving me mad, because I actually made some progress). I tried few combinations in Windows proxy settings, maybe one even worked in the past, now the don't (I have the default). </p>
  
  <p>Attached is the attempt of formatting traceback of an logging in attempt, <a href="https://i.stack.imgur.com/D9Suz.png" rel="nofollow noreferrer">screen</a></p>
  
  <pre><code>Traceback (most recent call last): 
    File "c:\users\mateusz\appdata\local\programs\python\python36-32\lib\site-
  packages\flask\app.py", line 1982, in wsgi_pp
      response = self.full_dispatch_request()
    File "c:\users\mateusz\appdata\local\programs\python\python36-32\lib\site-
  packages\flask\app.py", line 1615, in full_dispatch_request
      return self.finalize_request(rv)
    File "c:\users\mateusz\appdata\local\programs\python\python36-32\lib\site-
  packages\flask\app.py", line 1632, in finalize_request
      response = self.process_response(response)
    File "c:\users\mateusz\appdata\local\programs\python\python36-32\lib\site-
  packages\flask\app.py", line 1858, in process_response
      self.save_session(ctx.session, response)
    File "c:\users\mateusz\appdata\local\programs\python\python36-32\lib\site-
  packages\flask\app.py", line 924, in save_session
      return self.session_interface.save_session(self, session, response)
    File "c:\users\mateusz\appdata\local\programs\python\python36-32\lib\site-
  packages\flask_session\sessions.py", line 355, in save_session
      total_seconds(app.permanent_session_lifetime))
    File "c:\users\mateusz\appdata\local\programs\python\python36-32\lib\site-
  packages\werkzeug\contrib\cache.py", line 769, in set
      self._prune()
    File "c:\users\mateusz\appdata\local\programs\python\python36-
  32\lib\sitepackages\werkzeug\contrib\cache.py", line 725, in _prune
      expires = pickle.load(f)
  _pickle.UnpicklingError: invalid load key, '\x00'.
  </code></pre>