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 don't work for pages with UpdatePanel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Grandy - 28 Jul 2007 00:35 GMT
Is anyone finding that cookies added to the Response.Cookies collection
within pages which contain an UpdatePanel do not exist in the
Request.Cookies collection when the page is posted back ?

These should be complete page postbacks not partial postbacks, because the
postback in question is not triggerred by a control inside the UpdatePanel
(nor is it a trigger control for an UpdatePanel), but, not knowing all the
details of how AJAX works, perhaps it is possible that XmlHttpRequest is
handling the postback even in this case and does not handle Cookies properly
...
bruce barker - 28 Jul 2007 00:58 GMT
updatepanels use ajax to postback via XMLHttpRequest. the ajax request
will send the browser cookies, but the browser does parse the response
headers, so it will not see a cookie headers added.

this means if you set a cookie is a partial update, the browser will not
see, and can not send on a full post. this is why partial page updates
do not update session/login cookie timeouts.

-- bruce (sqlwork.com)

> Is anyone finding that cookies added to the Response.Cookies collection
> within pages which contain an UpdatePanel do not exist in the
[quoted text clipped - 6 lines]
> handling the postback even in this case and does not handle Cookies properly
> ...
John Grandy - 28 Jul 2007 01:22 GMT
But I'm not adding/setting my cookies during a partial update.  I'm using
Page.Response.Cookies.Add during the initial page load ... but on post back
Page.Request.Cookies does not contain the cookie.

> updatepanels use ajax to postback via XMLHttpRequest. the ajax request
> will send the browser cookies, but the browser does parse the response
[quoted text clipped - 16 lines]
>> XmlHttpRequest is handling the postback even in this case and does not
>> handle Cookies properly ...

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.