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

What are the principal differences between the lambda and def?

0 Answers  


Explain the shortest way to open a text file and display its contents?

0 Answers  


What is a namespace in python?

0 Answers  


What are the disadvantages of the python?

0 Answers  


Explain about the programming language python?

0 Answers  






We know python is all the rage these days. But to be truly accepting of a great technology, you must know its pitfalls as well. Would you like to talk about this?

0 Answers  


Is r similar to python?

0 Answers  


Write a script to connect to MySql database using Python?

0 Answers  


What are the modes to open a file in python?

0 Answers  


How do you make 3d plots/visualizations using numpy/scipy?

0 Answers  


Write a one-liner that will count the number of capital letters in a file. Your code should work even if the file is too big to fit in memory.

1 Answers  


How do I run python in notepad ++?

0 Answers  


Categories