This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Can we preserve the session while navigating to PDF  RSS feed

 
Ranch Hand
Posts: 42
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a scenario where i am opening a PDF file on click of a link which opens in new window. PDF is dynamically created depending on the link. and on that PDF i have few buttons. On click of these buttons, it opens a new page which navigates to a jsf page but the session is not getting becoming invalid. What should i do? if any of you having any idea then please guide me to solve this.

I hope you all got my problem, if not then please ask me to elaborate more.

Thanks,
Mahendra
 
Mahendra Pratap
Ranch Hand
Posts: 42
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried appending session Id to the URL but then also i am getting the Logout page..



This is how i used URL rewriting where jsessionId is session Id from JSF managed bean and abcId is some other parameter i am passing..

 
Bartender
Posts: 20101
101
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These days, session IDs are mostly passed in cookies, but occasionally you'll have someone who refuses cookies, so a truly robust webapp will also support URL rewriting.

However, the cookie is attached to the browser, so unless your system is set up to launch a different web browser when you click in a PDF, I don't think it should be losing the session on that account.

A more serious problem is that PDF's have an indefinite lifespan, but sessions are normally quite limited. So if I print a PDF today and click on the link tomorrow, that's simply not going to work. The session will almost certainly have been destroyed.

Which is just as well, since if the application is a secure one, you'd have a major security issue if someone could just click and go right in.

Rather that attempting to put a session ID in the PDF, you should look at putting some sort of information that can be used to reconstruct whatever session context you need when the link/button is clicked.
 
Mahendra Pratap
Ranch Hand
Posts: 42
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply Tim.

yes system is launching different browser on click on PDF.


Rather that attempting to put a session ID in the PDF, you should look at putting some sort of information that can be used to reconstruct whatever session context you need when the link/button is clicked.


the session context i want to preserve is user details as the user is logged in and i don't want the system to ask user for logging again. do you have any idea how can we achieve this?
 
Let me tell you a story about a man named Jed. He made this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!