Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

cookies not persisting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Grandy - 27 Jul 2007 22:06 GMT
I'm not finding cookies I create to persist. I don't see any corresponding
file in

C:\Documents and Settings\jgrandy\Local Settings\Temporary Internet Files

and the cookie is not present in the Request.Cookies collection on postback.

Here is how I am creating the cookie :

HttpCookie cookie = new HttpCookie("MyCookie");
cookie.Expires = DateTime.Now.AddYears(1);
cookie.Value = "written " + DateTime.Now.ToString();
cookie.Path = "folder1/folder2";
Response.Cookies.Add(cookie);
Riki - 28 Jul 2007 14:24 GMT
> I'm not finding cookies I create to persist. I don't see any
> corresponding file in
[quoted text clipped - 10 lines]
> cookie.Path = "folder1/folder2";
> Response.Cookies.Add(cookie);

When you set the Path to "folder1/folder2", the cookie will only apply to
files in that folder.
Is your page in that folder?

Secondly, cookies for Internet Explorer are not kept in C:\Documents and
Settings\jgrandy\Local Settings\Temporary Internet Files, but in
C:\Documents and Settings\jgrandy\Cookies.

Signature

Riki

John Grandy - 30 Jul 2007 18:33 GMT
Cookies show in both folders. I'm not sure why Explorer shows them that way,
and I'm not sure where they actually are located, but that's how Explorer
shows them.

My page is in the folder pointed to by Cookie.Path, but that setting did
turn out to be the culprit. Not sure why.

>> I'm not finding cookies I create to persist. I don't see any
>> corresponding file in
[quoted text clipped - 18 lines]
> Settings\jgrandy\Local Settings\Temporary Internet Files, but in
> C:\Documents and Settings\jgrandy\Cookies.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.