Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

iframe session problem

 
Niels Bosma
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a problem with running a site in an iframe. We've developed a system that uses session variables but when running the site in an iframe we get weird (non-exsisting) behavior with the session vars.

Even more weird is that if I open the page (that's runned in the iframe) and do some stuff that affects the session and then open the page with the iframe, it works fine...

Note that the page that loads the other page via the ifram is on a diffrent server...

Someone know why I get this behaviour?
/Niels
 
Jeffrey Spaulding
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Session persistence is handled via cookies. If you have different servers in the game, the cookies might become invisible (depends on the domainnames).

You can use Plan B for session persistence by rewriting your url as in



You have to do that by force and not with HttpServletResponse.encodeURL()
since as soon as cookies are active there is no rewriting done.

J.
 
Niels Bosma
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, thanks. Gonna be a fun workday then, rewriting all url's and actions.

You have to do that by force and not with HttpServletResponse.encodeURL()
since as soon as cookies are active there is no rewriting done.


What do you mean with by force?
 
Niels Bosma
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I need to create a function that takes an url and appends the session var? What parameter name? 'jsessionid'?

Will the servlet-container automatically understand that this is a sessionid??

What is the best algorithm for this function?
/Niels
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic