Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

user session details gets refreshed after navigating to new page

 
Aditi Tervankar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Team,

I am trying to add href in jsp page to navigate to another URL from first jsp page, this second page will get opened as new window.
However my both jsp pages need user to enter different credentials.
When user logs in to first page by entering user/pwd details and navigate to another page using link which is added as href in my first page, the new window gets opened by asking user for another credentials of that second page.

When user enters another credentilas and try to access the first page again, then again user needs to enter user/pwd details, which I want to avoid , can you please suggest on this.
 
Swastik Dey
Rancher
Posts: 1603
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean the credentials entered in 2nd page will be used in first page when the user navigates back from 2nd to 1st page?
 
Aditi Tervankar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I meant it is trying to use session created after entering credentials used in second page and try to map that session with first page session, and it fails in that because both pages uses different credentials. Hence when I try to access first page then it again ask to enter credentials which it should not ask. Because once both pages are opened in different window so both pages should be accessible simultaniosly without any problem.

My problem is that after opening second page in new window, I can not access first page without entering its credentials again.

 
Swastik Dey
Rancher
Posts: 1603
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So far what I could understand is you have different credentials for two different pages, and when the user navigates back to the first page from 2nd page, the first page looses the credentials entered for it and asks for the credentials again. Please correct me if I am wrong.
 
Aditi Tervankar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, thats correct but partially, we hv different credentials for two diff. pages.
Only thing is that there is no any link for navigating back from second page to first page. Because I am using href and having link to go to second page, once clicked on that it will get opened in new window and I can see both the windows (pages) opened.

<a=href="https://../secondpage.jsp" target="_blank" >

But once second page is opened , now the first page looses the credentials entered for it and asks for the credentials again. As both pages are using secure channel.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is this part necessary: "https://.."?

If the pages are in the same we app, you should be using server-relative addresses. If it's to switch protocols, well, you cannot share a session between http: and https:
 
Aditi Tervankar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Pages are not within same application, I am opening aother application from my existing application, hence HTTPS is required as both are user access restricted application.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the pages are in separate apps, they cannot share a session. If you want to share logged-in status across the disparate apps, you will need to implement so sort of SSO (single sign on) capability.

SSO is not built into the Servlets or JSP containers.

P.S. Using a URL such as "https://../secondpage.jsp" to cross the apps is horribly fragile.
 
Aditi Tervankar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bopth applications are using SSO only.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic