Welcome Guest Search | Active Topics | Sign In | Register

eo.pdf Cookies Timing out Options
craig hollaman
Posted: Thursday, September 29, 2016 4:42:07 AM
Rank: Newbie
Groups: Member

Joined: 9/29/2016
Posts: 1


Hi, we have recently changed the way we generate a PDF. Having to use cookies, because we were getting a 500 error. The below works however its terribly slow and times out all the time ( although it does generate the document )
Any ideas. ( using asp. net VB )



For Each cookiekey As String In Request.Cookies
Dim cookie = Request.Cookies(cookiekey)
Dim pdfcookie = New System.Net.Cookie(cookie.Name, cookie.Value)
pdfcookie.Domain = cookie.Domain
pdfcookie.Expires = cookie.Expires

EO.Pdf.HtmlToPdf.Options.Cookies.Add(pdfcookie)

Next

EO.Pdf.HtmlToPdf.ConvertUrl(ConvertRelativeUrlToAbsoluteUrl("~/Customer/QuoteDocument.aspx?id=" & quoteid & Breakdown), quotefilepath + quotefilename)
eo_support
Posted: Thursday, September 29, 2016 9:36:23 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

This is normal. You are running into ASP.NET session lock issue. Once you duplicate the cookie, the server will treat the session that servers the current page (where you call ConvertUrl, call this page A) and the session that servers the page to be converted (your QuoteDocument.aspx, call this page B) to be the same session and they would share the same session lock (this is why you do not have to lock anything when you access your session variable) and the following deadlock would occur:

1. Page A already holds the session lock S;
2. Page A calls ConvertUrl to render page B, which will try to acquire the same session lock S and it is unable to. So it waits until S to be released;
3. S will never be released because step 2 does not return;

The easiest way for you to work around this problem is to use our ASPXToPDF/MVCToPDF control. Those two controls have special logic that handles this scenario so they can avoid session lock. You can also avoid this problem by making sure you do not duplicate your session ID cookie.

Hope this helps. Please let us know if you still have any questions.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.