Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with session and frames  RSS feed

 
Ashwin Sharma
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
V Sahdev
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
Ashwin Sharma
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!