Welcome Guest Search | Active Topics | Sign In | Register

This session is no longer valid Error Options
Rahesh
Posted: Monday, June 11, 2012 5:25:03 AM
Rank: Newbie
Groups: Member

Joined: 6/7/2012
Posts: 6
When I try to convert '.aspx ' page to pdf will get the following error
'This session is no longer valid. If you wish to reuse the session later, please consider calling GetCookies to retain the session cookies, then reuse these cookies through HtmlToPdfOptions.Cookies with another session.'
eo_support
Posted: Monday, June 11, 2012 8:52:28 AM
Rank: Administration
Groups: Administration

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

The error message is already quite clear about what you need to do. Don't just post an error message here. We don't investigate your issue you just because you get an error message. Post detailed information about your scenario, what you have done while trying to troubleshoot the problem, how to reproduce the problem, etc.

Thanks
Rahesh
Posted: Monday, June 11, 2012 9:34:11 AM
Rank: Newbie
Groups: Member

Joined: 6/7/2012
Posts: 6
In local system it working fine .We published and uploaded the site in server and getting the display as shown in below link

http://glenspark.info/Error/error.JPG

The message in the pdf display as shown below

"EO.Pdf.Internal.ky: This session is no longer valid. If you wish to reuse the session later, please consider calling GetCookies to retain the session cookies, then reuse these cookies through HtmlToPdfOptions.Cookies with another session."

print button click

protected void printdata(object sender, EventArgs e)
{

Session["url"] = "SalesListPrint.aspx?SalesFrom=" + TxtSalesFrom.Text + "&SalesTo=" + TxtSalesTo.Text + "&SalesNo=" + TxtSalesNo.Text;

ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script language=javascript>window.open('../PrintAsPdf.aspx','PrintMe','height=600px,width=600px,scrollbars=1');</script>");

}

PrintAsPdf.aspx page

protected void Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{

// our license key added here

PdfDocument doc = new PdfDocument();
string url = Request.Url.ToString();
string[] str = url.Split('?');
url = str[0].Replace("PrintAsPdf.aspx", Convert.ToString(Session["Url"]));
HtmlToPdf.ConvertUrl(url, doc);
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.ClearHeaders();
response.ContentType = "application/pdf";
doc.Save(response.OutputStream);

}

}
eo_support
Posted: Monday, June 11, 2012 9:45:31 AM
Rank: Administration
Groups: Administration

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

Do you get this problem every single time when you try to convert a page, or just on some conversions?

Thanks
Rahesh
Posted: Monday, June 11, 2012 11:53:41 PM
Rank: Newbie
Groups: Member

Joined: 6/7/2012
Posts: 6
I got this problem every single time when I try to convert a page.

Thanks
eo_support
Posted: Tuesday, June 12, 2012 7:19:58 AM
Rank: Administration
Groups: Administration

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

Please try to convert a separate page that is not a page on your website and see if that works. If that works, then most likely you have a DNS issue that would prevent you to access any of your own page:

http://www.essentialobjects.com/ViewDoc.aspx#debug

The topic is for ASPXToPDF but applies to your scenario as well.

Thanks!
Rahesh
Posted: Wednesday, June 13, 2012 11:59:29 PM
Rank: Newbie
Groups: Member

Joined: 6/7/2012
Posts: 6
Hi,

I removed the 'Global.asax' file from my site ,then it works fine in local as well as server system.


Thanks
eo_support
Posted: Thursday, June 14, 2012 9:14:03 AM
Rank: Administration
Groups: Administration

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

Thanks for the update. That is something new that we are not aware of. But I am glad that it worked out for you.

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.