Question

When a user login your system,he wants to edit his personal information which is on the other page.I put a hyperlink named edit on logined.html,but how can I pass the user's id to edit.html?

I am using python's web.py web framework.Please help me.Many thanks!

Was it helpful?

Solution

There are multiple ways to do this. The usual way is to have all user data in server-side session store, and only give the client-side the session ID instead of user ID and similar sensitive information.

Your form would work without the user information, and then when you are handling the submitted data, you retrieve the user information from the session and basically assume that the user submitted it. There are ways to make this assumption safer by using CSRF protection, etc.

More on sessions in web.py: http://webpy.org/sessions/

More on CSRF protection: http://webpy.org/cookbook/csrf

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top