hi I am using tomcat 6. I am using frame which displays login page. After any user login, servlet stores the user id in the session (request.setSession ("userId", userId)). Then server returns the frame to browser. This frame is used to divides the page into two. Left frame calls the url which displays the list of things user can do(which is stored in database). But when servlet tries to retrieve users id from session, it is getting null. When I am printing session id while storing the user id and while retrieving it I am getting different session id. It is working on linux machine and firefox browser. But when I run tomcat server from windows XP, it is not working with any of the browser, IE and firefox. Also I heard it is good practice to call session object before any thing is written to output, so I am calling it at the start, even than its not working.
What are you saying & doing doesnt smell like a problem ? But for anyone to help you , first you provide your code snippets here. ! Also, are you sure that your session is not timing out .
posted 12 years ago
It seems I was unable to explain my problem properly, so let me try again I have a servlet named home and below is the sequence of events browser request(url = localaddress/home) -> home servlet returns login page -> user logins -> login servlet validated and stores user id in session variable and returns a frameset
Then event_management servlet is called from leftFrame. This servlet when tries to retrieve user id back from session variable, it is getting null. So I tried to print session id in both home servlet and event_management servlet but both session ids are different.
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?