Question

I have written an application using flask. Part of the application creates a dictionary and then the dictionary gets parsed into json(string) with json.dumps. The string then gets stored as a cookie. Everything was working fine in development.

I set up a production environment and when the above process takes place, I am unable to read the cookie with javascript. Upon examining the cookie, I can see that an ASCII octal character for comma has been added: \054.

There are supposedly no differences between my development and production environments. I did have a newer version of flask in production and read that they changed how cookies are stored, so I blew away flask 0.10.1 and installed 0.9 which is what is on my development environment, but the problem persists.

Any ideas where this comma is being replaced by the octal code?

Était-ce utile?

La solution

I ended up passing a urlencoded cookie instead of json. This is a hack. I am not really satisfied with this fix right now.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top