Answer Posted / chaitanya
Sessions are the server side version of cookies. While a cookie preserves state at the client side, sessions preserves state at server side.
The session state is kept in a file or in a database at the server side. Each session is identified by a unique session id (SID). To make it possible to the client to identify himself to the server the SID must be created by the server and sent to the client whenever the client makes a request.
Session handling is done through the web.session module in the following manner:
import web.session session = web.session.start( option1, Option2,... )
session['myVariable'] = 'It can be requested'
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is hello world in python?
What is the purpose of bytes() in python?
Name some standard python errors you know?
What is a pure function python?
Can a beginner learn python?
Is vs in python?
Why do array indexes start with 0 in most languages?
Can you use tabs in python?
What is a docstring?
How can you randomize the items of a list in place in python?
What is difference between range and arange function in python?
How will you find, in a string, the first word that rhymes with ‘cake’?
What is meant by“call by value” in python?
What are tuples in python?
Does python have inheritance?