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 to check whether a module is installed in python?

0 Answers  


How can you get the google cache age of any url or web page?

0 Answers  


Specify the differences between pyramid, django, and flask.

0 Answers  


What is a palindrome number?

2 Answers  


How to check if string A is substring of string B?

0 Answers  


Is python pass by reference?

0 Answers  


Write a program to check given number is prime using for loop with else?

0 Answers  


How to send a object and its value to the garbage collection?

0 Answers  


Does python have long?

0 Answers  


Why do I receive a syntax error when printing a string in python 3?

0 Answers  


Write program to find the common elements from two sets?

0 Answers  


Who developed python?

0 Answers  


Categories