This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

session is lost when doing window.open()  RSS feed

 
Beksy Kurian
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
session is lost when doing window.open from a jsp page. When a user clicks on this link, jsp directs it to the servlet, do some database work and should returns the info in the pop up window. openwindow is a function I have written which takes 3 parameters, url,width,height.It opens up a new window. Since the session is lost it is redirecting to the login page(login box is coming in the pop up window). Can anybody explain why? And a possible solution, if any!
Webserver is Iplanet, servlet engine is Jrun and browser is IE5.5.

Beksy
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Beksy
Try the encodeURL( ) method to encode the url of the window your opening. I assume baselink is the url of the new window then something like this should do it.
<%=response.encodeURL(baseLink)%>
all that does is put the session id on the end of the url as an additional name/value pair in the query.
hope that helps
 
Beksy Kurian
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! I got the sessionid by explicitly doing as request.getSession().getId()
How do we convert it into a session object if we know the session id. I need to store an arraylist into the session which I later access in the jsp(which comes in the pop up window)?
Beksy
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!