• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

new session between jsp pages  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I'm a beginner with jsp/servlet/bean. And after many hours of reading, and trying I'm completely frustrated.

I'm trying to move between jsp pages, and I'm always getting a new session.
I read many articles and posts but can't find what I'm doing wrong.

In every page I include a "status.jsp" where I check if the user is logged in.


In every jsp page:
<%@ include file = "/includes/status.jsp" %>

I always get a new session.

I tried inserting the code into each jsp. Same thing: new session. I've also included
<%@ page session="true" %>
in each jsp. I know that the default is true, it's just I don't know what else I can try.

I've also tried to send the jsessionid through href.
<a href="/jsp/item.jsp?ISBN=<%=isbn%>&jsessionid=<%= session.getId()%>">view </a>
Didn't work either

I move the code from one machine to a new one 10 days ago.
Could it be a problem with tomcat?

Thanks
Teresa

[BSouther: Added UBB CODE tags]
[ January 07, 2007: Message edited by: Ben Souther ]
 
Teresa Dodero
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the problem!!!

If I access with my IP instead of localhost it works perfect!
Why???
Does anybody know?

Teresa
 
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It probably has to do with the way that your browser is dealing with cookies.
 
Teresa Dodero
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear,

I use IE 7 and Firfox 2, and I have the same problem with both of them.
Either if I access with localhost or 127.0.0.1 I can not handle the sessions.

But if I access from any other machine, or 192.168.1.103 in the local, everything works perfect.

The problem is, that I need it to work in this machine which is a laptop.

At least I know that it is not a coding problem. Now I have to find out if it is a browser or a tomcat issue. Or maybe both. I have no clue.

Teresa
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!