• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to pass session to different web pages

 
Hideki Mae
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To all:
Is there a way to pass session from one web application to another web application? For example, I have a web app (context root is /dwm), and in this application I do "session.setAttribute("tablist", tablist);" The variable tablist is an array containing names of a tab button which takes me to a different web app (context root is /rehabweb). In /rehabweb I would like to generate the tab buttons again by doing: "tablist = session.getAttribute("tablist");" so I don't have to go to the database to get it again. When I check my debugger the session variables from /dwm are gone once I reach /rehabweb.
Can you pass session id as an query parameter and retrieve the original session somehow? I'm not sure how you would do this.

Thank you for any help you can give me.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hideki,
Web applications cannot share sessions. Different web pages within the same web application can though.
 
Ankush Bhargava
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well try serialising your httpsession object. add it to the database.
and then deserialise the same object in the ohter application!
that should work for you
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankush has a good point about serializing data. However, it is better to store just the needed data than the whole session.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
session serialisation might look a nice idea but you're in for big trouble as session ids will get messed up royally in the application that does the deserialisation
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic