JSP: new Session created on every access of page

J

Joe Randstein

Hi!
I have a little problem with my JSPs. A new session is constructed
every time the page is accessed, sure it is not working that way, as I
can't store any data that way.

I developed the code at home on Windows/Tomcat4.0.6 and it worked as
it should, but when I deployed it on a Linux server the problem
started. Every time the session has a new ID, isNew() responds with
true.
From my observation the browser isn't getting a cookie, so it
obviously can't send back the cookie the next time it accesses the JSP
and that should explain why a new session is created every time.
But handcrafted cookies work on the Linux server and Browser, I tested
that. But I wanted to use the session API and not do the work by hand.

Does anybody have an idea what can be wrong? Is there a parameter I
can check? Or a check in the tomcat config?


Thank you very much for your responses
 
C

Chris Smith

Joe said:
Hi!
I have a little problem with my JSPs. A new session is constructed
every time the page is accessed, sure it is not working that way, as I
can't store any data that way.

I developed the code at home on Windows/Tomcat4.0.6 and it worked as
it should, but when I deployed it on a Linux server the problem
started. Every time the session has a new ID, isNew() responds with
true.
From my observation the browser isn't getting a cookie, so it
obviously can't send back the cookie the next time it accesses the JSP
and that should explain why a new session is created every time.

What have you observed to indicate that the server is not sending the
cookie?

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
J

Joe Randstein

Chris Smith said:
What have you observed to indicate that the server is not sending the
cookie?

I turned on the browser cookie warning, which pops up a requester
every time a cookie is received. No requester came when a new session
was started, but a request came when I sent a handmede cookie in my
jsp. So I assume somehow tomcat was not generating a cookie for me,
but I don't know the reason ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top