Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loosing session variables between JSP applications

Status
Not open for further replies.

Smith5646

Programmer
Feb 18, 2004
2
US
I am loosing session variables between JSP applications running on Tomcat 5.0.18.

The first app is a login application which defines a menu for the user. It's path is 127.0.0.1:8080/Security. When the user logs in successfully, I set a session variable session.setAttribute("UserID", "Smith5646"); If I check this variable later in another JSP page in the /Security directory using session.getAttribute("UserID") it returns Smith5646 as expected.

When the menu is displayed from /Security and I click a link that goes to another path such as 127.0.0.1:8080/MyTestApp, when I do a session.getAttribute("UserID") it returns null.

Are session variables path specific? I thought they were global to the browser session but this does not appear to be the case. Is there a tomcat config setting I've missed or something? If not, is there a way around this so I can pass session variables between applications?
 
From your information provided, there are TWO separate web applications called "Security" and "MyTestApp". Session variables won't be shared among applications.

Try to create a master directory (e.g. App) to include your two directories:
/App/Security
/App/MyTestApp

 
i'm having the same problem but i'm not using two different web apps. for some reason when i use the session.setAttribute method in one jsp, no other jsp's can see it.

help !!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top