| | |
cookie problem with iframe and different domain
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2005
Posts: 1
Reputation:
Solved Threads: 0
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:
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:
•
•
•
•
<%
'/// Get Nick Name
nick=request("nick")
xlaSBnick=request.cookies("xlaSBnick")"
if nick<>"" then
response.cookies("xlaSBnick")=nick
xlaSBnick=nick
end if
if xlaSBnick="" then
formproperties="action=bottomframe.asp onsubmit='return validatenick();'"
else
formproperties="action=receiveframe.asp target=xlaSBreceive onsubmit='return shout();'"
end if
%>
•
•
Join Date: Sep 2007
Posts: 1
Reputation:
Solved Threads: 0
•
•
•
•
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:
•
•
Join Date: Sep 2007
Posts: 12
Reputation:
Solved Threads: 1
You can not using cookies. You should use javascript to send the information to the iframe
you can set the domain on a cookie as follows
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
ASP Syntax (Toggle Plain Text)
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
ASP Syntax (Toggle Plain Text)
Response.Cookies("CookieName").Path = "/maindir/subdir/path"
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
•
•
Join Date: Dec 2008
Posts: 1
Reputation:
Solved Threads: 0
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
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
HttpContext.Current.Response.AddHeader("p3p", "CP=\""IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""")PhP code
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');For more information on this, please visit this url:
http://viralpatel.net/blogs/2008/12/...th-iframe.html
![]() |
Similar Threads
- Dynamicallu Resizeing IFRAME based on content (JavaScript / DHTML / AJAX)
- how do i escape from an iframe? (HTML and CSS)
- SQL slow in Domain Control (MS SQL)
- Domain same name as website.. problems (Windows NT / 2000 / XP)
- XP hungs task bar hungs on joining a domain (Windows NT / 2000 / XP)
- Dynamic iframe height ? (HTML and CSS)
- problem:on click button pagr refresh again (VB.NET)
- ...Not sure where the problem lies... (Web Browsers)
Other Threads in the ASP Forum
- Previous Thread: can caching improve speed
- Next Thread: validate anchor tag
Views: 21463 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for ASP
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection calendar changeable connection current database databaseconnection diagnostics dreamweaver excel fso html iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile query record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit update web webserver windows7





