Describe how to implement Cookies for Web python.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does == mean in python?

509


What are special methods in python and how to implement?

483


Is python pure object oriented programming ?

470


What is a python egg?

455


What are its benefits of flask?

449






What is os module?

476


Why is python used?

411


What is the encapsulation?

468


How to count the occurrences of a list item?

439


Is there any equivalent to scanf() or sscanf()?

528


Is python good for microservices?

411


What is the other way of checking truthiness?

489


As python is more suitable for the server-side application, it is very important to have threading implemented in your server code. How can you achieve that in python?

454


How to split a string into a list?

476


Is __ init __ necessary in python?

473