Describe how to use Sessions for Web python.
Answer / 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 |
Is map faster than for loop python?
What is subn() function?
What does the term ‘monkey patching’ refers to in python?
what is the statement that can be used in python if the program requires no action but requires a statement syntactically?
Is python 0 based?
How do you get all values from a python dictionary?
What is frozen set in python?
What is a coverage report?
Explain how Python is an interpreted language
Are there maps in python?
How do you use isalpha in python?
Can you override functions in python?