Describe how to use Sessions for Web python.



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

Post New Answer

More Python Interview Questions

How does the python version numbering scheme work?

0 Answers  


Give an example of shuffle() method?

0 Answers  


What is Python Set?

0 Answers  


What is sub() function?

0 Answers  


Which software is best for python programming?

0 Answers  






Tell me what is negative index in python?

0 Answers  


The following is displayed by a print function call?

0 Answers  


How to test multiple variables against a value?

0 Answers  


What command do we use to debug a python program?

0 Answers  


What are python’s dictionaries?

0 Answers  


How do I run a python file in python shell?

0 Answers  


What does the ord() function do in python?

0 Answers  


Categories