views:

66

answers:

1

Hi,

I have created javascript cookie for storing the last visited pages(3) URL in sharepoint .It is working correctly at any .NET website and creating one cookie text (cookie) file at C:\Documents and Settings[user-name]\Cookies .But for sharepoint portal the links are sites and different pages.It is craeting different cookie (text) file for different sites inside C:\Documents and Settings[user-name]\Cookies when I try to visit different link.This situation creating same name-value pair for each site and giving me wrong result.Can I over write same cookie text file ? If yes please let me know how I can do that?

Thanks in advance.

Ashar

+1  A: 

Cookies are linked to a domain name, including (by default) subdomain. When creating the cookie, you can specify the domain name that it should be associated with. This is to ensure that (for instance) a page from aaa.example.com and a page from bbb.example.com can both set and read cookies for example.com. More here. (You can't just set any domain name, it has to be a subset of the one the response came from. E.g., from aaa.example.com you can say the cookie is for example.com but not google.com because the response has nothing to do with google.com.)

If you want to use the same cookie on pages from unrelated domains, you'll have to set the cookie as a third-party cookie via an image or similar. More in a different section of that same article.

T.J. Crowder
Thanks for reply T J. My problem is it creating different files for one portal on different links so I am not able to overwrite name-value rather than it is creating new cookie text file some links.Can I control/force this at javascript code level so that it will take same file for whole portal.Thanks
Ashar
@Ashar: I'm sorry, I don't think I understand. Can you explain further?
T.J. Crowder