Is there any way in django to store cookies which is independent to browser ? is there any technique just like what flash SharedObject does ..?
views:
63answers:
3As it's explain in the link you give in your comment, Shared Objects are not stored as browser cookies, they are completely managed by the Flash Player. That's why they are independent of the browser.
So the answer is no, you can't store a cookie that is independent of the browser with Django (or any other web framework).
A possible solution is, if your visitor need to log to your site, you can store the info on the server, probably in a database. But if you don't required users to be log in, it will not work. Your other solution is to use Flash only to store the cookies.
A Django view receives an instance of HttpRequest as its first argument. That object has an attribute COOKIES which is, and I quote,
A standard Python dictionary containing all cookies. Keys and values are strings.
You can of course save that dictionary in any way you like (e.g., pickle it into a blob of bytes and save that blob as a suitable attribute of a suitable entity, etc, etc).
Conversely, when you instantiate an HttpResponse to return as the view's result, you can call its set_cookie method one or more times to set on it any cookies you may want to set.
There is no way to set cookie, so that it would be available in all browsers on computer. You can do it in Flash, because it is external library (one for all browsers).