Hey i have a webpage for searching a database. i would like to be able to implement cookies using python to store what a user searches for and provide them with a recently searched field when they return. is there a way to implement this using the python Cookie library??
Usually, we do the following.

Use a framework.
Establish a session.  Ideally, ask for a username of some kind.   If you don't want to ask for names or anything, you can try to the browser's IP address as the key for the session (this can turn into a nightmare, but you can try it.)
Using the session identification (username or IP address), save the searches in a database on your server.
When the person logs in again, retrieve their query information from your local database.

Moral of the story.  Don't trust the cookie to have anything it but session identification.  And even then, it will get hijacked either on purpose or accidentally.

Intentional hijacking is the way one person poses as another.
Accident hijacking occurs when multiple people share the same IP address (because they share the same computer).
Using cookies with python to store searches