Describe how to implement Cookies for Web python.
Answer / chaitanya
A cookie is an arbitrary string of characters that uniquely identify a session.
Each cookie is specific to one Web site and one user.
The Cookie module defines classes for abstracting the concept of cookies. It contains following method to creates cookie
Cookie.SimpleCookie([input])
Cookie.SerialCookie([input]
Cookie.SmartCookie([input])
for instance following code creates a new cookie ck-
import Cookie
ck= Cookie.SimpleCookie ( x )
| Is This Answer Correct ? | 0 Yes | 0 No |
Is all the memory freed when python exits?
What is the lambda?
How does the ternary operator work in python?
is there any maximum length expected for an identifier?
How will you find, in a string, the first word that rhymes with ‘cake’?
What is python's parameter passing mechanism?
Why to use python numpy instead o f lists?
How do I call a method defined in a base class from a derived class that overrides it?
What is the difference between re.search and re.match?
Why do we use sets in python?
How do I apply a method to a sequence of objects?
What is the method does join() in python belong?