How to use Sessions for Web python?

Describe how to use Sessions for Web python.

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'
How exceptions are handled in python?
How exceptions are handled in python? - Errors detected during execution of program are called exceptions. Exceptions can be handled using the try..except statement.......
What is used to create Unicode string in Python?
Unicode is a system to represent characters from all the world's different languages.......
When to use list vs. tuple vs. dictionary vs. set?
List is like array, it can be used to store homogeneous as well as heterogeneous data type (It can store same data type as well as different data type). .....
Post your comment