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 do you sort in python 3?

0 Answers  


Explain the difference between a list and the tuple?

0 Answers  


how do you debug a program in python?

0 Answers  


What is the difference between the shallow copy and deep copy in python?

0 Answers  


What are the attributes?

0 Answers  






What is argument in a function?

0 Answers  


Is python interpreted language?

0 Answers  


Name some python libraries?

0 Answers  


Which module(s) of python can be used to measure the performance of your application code?

0 Answers  


How do I put python to sleep?

0 Answers  


How would you define a protected member in a python class ?

0 Answers  


What do you mean by *args and **kwargs?

0 Answers  


Categories