This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Loosing session and request object while doing response.sendRedirect(url) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Loosing session and request object while doing response.sendRedirect(url)" Watch "Loosing session and request object while doing response.sendRedirect(url)" New topic
Author

Loosing session and request object while doing response.sendRedirect(url)

Rashmi Anand
Greenhorn

Joined: Feb 10, 2009
Posts: 11
Hi ,

I have two applications which are hosted in two different domains.

I have to pass the control from 1 application of 1 domain to another application in different domain.
I cant use requestDispatcher because they are in different domains.

As of now i am using sendRedirect(url): url which is a String is having differt domain application url.
The control is passed but the attributes i had set in session and request objects are not available.

Please let me know how can i retain session and request objects after giving control to different application.

TIA
Rashmi
Ra Re
Greenhorn

Joined: Nov 13, 2009
Posts: 6
Employing sessions across JVMs (two different domains) requires an HttpSessionActivationListener

Some info:
http://faq.javaranch.com/java/HttpSessionActivationListener
http://www.coderanch.com/t/474955/Servlets/java/What-happened-session
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

What you are asking for cannot be done. You cannot pass sessions that exist in say gmail.com and send them over to yahoo.com.

Raimon what you are pointing to is an interface that acts as a call back when objects are migrated across JVMs. This usually happens with fail over scenarios or to maintain hot backups and load balance. Session objects as such cannot make a migration

You can pass your parameters over as request parameters


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Ra Re
Greenhorn

Joined: Nov 13, 2009
Posts: 6
That's true, my mistake.

Thanks for the explanation!
Rashmi Anand
Greenhorn

Joined: Feb 10, 2009
Posts: 11
Thanks Guys for all the reply.
I am planning to send the required details by appending to the URL in response.sendRedirect()
 
Don't get me started about those stupid light bulbs.
 
subject: Loosing session and request object while doing response.sendRedirect(url)
 
Similar Threads
java.sql.SQLException: ORA-00028: your session has been killed
Different sessions on different firefox tabs ?
send sessionid cookie while making the AJAX request call
Problems with lost sessions
Session conflict with servers on the same IP and different ports