We are using XMLFormView control on a frequently accessed page. We couldn't find a pattern but one each or random access of the page with xmlformview control it adds 2 cookies to the browser cache. The cookie names seems to auto-generated GUID based ones. It is formatted something like shown below:
06082d96-8920-4141-9d59-ce9e693fd60a_pb=0
95643ae8-8ca6-4d08-a7fa-1a41325b96b9_sel=%5B0%2C0%2C0%2C0%2C0%2C0%2CView%201%2C0%2C0%2C0%2C0%5D
If you observe the cookies always ends with _pb or _sel which actually represents postback and selection respectively. InfoPath uses these to save the state of the form. I was able to find that the SharePoint core.js file has functions which create cookies like these. But these cookies are never removed and it is piling up. Ultimately it reaches a point where the ASP.NET_SessionID cookie which represents the session shared between the browser and the server gets lost and the server sends a new session id which is making the application loose the existing session information.
I wrote a temporary patch for this by cleaning up the cookies on each page load. But not sure how this will effect the forms eventually.
Is there a better solution or a fix or the right way to do it?
I believe there is already a post which sounds very similar to this (http://www.infopathdev.com/forums/p/10711/38270.aspx)
Thanks!