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 2005

Tip: Looking for answers? Try searching our database.

Cookie problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tshad - 19 Jul 2005 09:09 GMT
I am trying to write out and update my cookies, but it doesn't seem to work
correctly.  I am using the following code:

if (passwordSaveCookie.checked) then
If Request.Cookies("User") is nothing Then
   Dim cookie As New HttpCookie("User")
   cookie.Values.Add("UN",UN.Text)
   cookie.Values.Add("UFN",dbReader("FN"))
   cookie.Values.Add("ULN",dbReader("LN"))
   cookie.Expires = DateTime.MaxValue
   Response.AppendCookie(cookie)
else
   response.Cookies("User")("UN") = UN.Text
   response.Cookies("User")("UFN") = dbReader("FN")
   response.Cookies("User")("ULN") = dbReader("LN")
End If
end if

What seems to be happening is that if you already have a cookie and you say
to save the cookie, it ties to save the cookie and shows the new cookie in
the Cookie manager in Mozilla.  So it seems to work.

But if you close the Browser and look, it isn't there.

If you now try to save it, it will work.

So it takes two times to make the change.  The first time it will delete the
cookie (even though it shows the new cookie there) and then when you try the
next time (after the cookie is gone), it works fine.

What am I missing here?

Thanks,

Tom
tshad - 19 Jul 2005 09:14 GMT
I find the same behavior with IE.

> I am trying to write out and update my cookies, but it doesn't seem to work
> correctly.  I am using the following code:
[quoted text clipped - 31 lines]
>
> Tom

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.