Skip to content

Set/clear autosave based on cookie.#2

Open
ctbarna wants to merge 3 commits into
mainfrom
server-cookie
Open

Set/clear autosave based on cookie.#2
ctbarna wants to merge 3 commits into
mainfrom
server-cookie

Conversation

@ctbarna
Copy link
Copy Markdown
Contributor

@ctbarna ctbarna commented Jun 6, 2014

A more likely use case than a user accidentally closing a window and losing work is that we have a server error after the form has already been submitted. At the point the server error comes through, the autosave will already have been erased.

This change introduced a cookie that is set on the client side via javascript and then modified upon successful save. If the save succeeds, the autosave and the cookie are erased.

ctbarna added 3 commits June 3, 2014 16:49
There is a cookie set on the client side that is modified on the server side
upon successful save.
Django appears to be naive about request cookies (not sure if it's django or
the way that cookies work in general). We need to explicitly set the path to
the referer, otherwise we end up with two cookies called "autosave_success."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants