![]() |
| ||
| cookie problem with iframe and different domain Hello everyone, I have an ASP chat inside an IFRAME. The ASP file is hosted on a different domain than the main website. When the user logs on by entering their name, the chat stores a cookie so the user can start posting messages. However since the cookie is stored using the main domain (not the iframe), the chat doesn't recognise it anymore and keeps asking to log on. How can I get it to recognise the cookie, or to store it with the correct domain? Your help is appreciated Here is the coding used by the chat to recognise the cookie: Quote:
|
| ||
| Re: cookie problem with iframe and different domain Quote:
|
| ||
| Re: cookie problem with iframe and different domain You can not using cookies. You should use javascript to send the information to the iframe |
| ||
| Re: cookie problem with iframe and different domain you can set the domain on a cookie as follows Response.Cookies("CookieName").Domain = "www.mydomain.com"and even a path of the cookie on that domain to make sure it can only be read by the path on that domain and not another Response.Cookies("CookieName").Path = "/maindir/subdir/path" |
| ||
| Re: cookie problem with iframe and different domain Some browsers allow third party cookies and in some browsers, like Internet Explorer, it depends on the privacy settings of the browser. In IE6 (Internet Explorer 6) with the default privacy setting of ‘Medium’, third party cookies will be deleted. As it turns out, there is a simple solution. If you supply a ‘compact privacy policy’ with your page, then IE will treat the cookies with respect and let them through. ASP.Net code
PhP code
For more information on this, please visit this url: http://viralpatel.net/blogs/2008/12/...th-iframe.html |
| All times are GMT -4. The time now is 4:33 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC