Javascript and sessions

37 views
Skip to first unread message

Luke Baker

unread,
Feb 26, 2014, 10:11:38 PM2/26/14
to django...@googlegroups.com
Hey there,

(Forgive my ignorance)

My web application is heavily based around form input. I'd like to update the user's session with each form input that they update or change while working with a form. I'm thinking of implementing some simple javascript that listens for 'change' events on each form input. When the 'change' event fires, I'd like to make an ajax request to update the users session with that form input name and value. To do this, I would have to write a view that would allow the user to POST any thing they wanted (essentially) to their session - is this safe? It makes me think twice.

C. Kirby

unread,
Feb 27, 2014, 1:08:46 PM2/27/14
to django...@googlegroups.com
It sounds like you are trying to implement a wizard. If you are, Django has one built in:

https://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/

Camilo Torres

unread,
Feb 27, 2014, 9:37:47 PM2/27/14
to django...@googlegroups.com
On Wednesday, February 26, 2014 10:41:38 PM UTC-4:30, Luke Baker wrote:
My web application is heavily based around form input. I'd like to update the user's session with each form input that they update or change while working with a form. I'm thinking of implementing some simple javascript that listens for 'change' events on each form input. When the 'change' event fires, I'd like to make an ajax request to update the users session with that form input name and value. To do this, I would have to write a view that would allow the user to POST any thing they wanted (essentially) to their session - is this safe? It makes me think twice.

Yes you must write that view. Sanitize the inputs.
Reply all
Reply to author
Forward
0 new messages