This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Servlets and the fly likes Session problem with IFRAME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Session problem with IFRAME" Watch "Session problem with IFRAME" New topic
Author

Session problem with IFRAME

siva kumarl
Greenhorn

Joined: Nov 29, 2008
Posts: 21
Hi Experts,

I am facing a session problem with IFRAME , i have two applications , i have used the IFRAME to include the Application 2 in Application 1 , while posting the request from first application through IFRAME , each and every request posted is treating as a new request , due to this i am facing session maintainence problem , i have stored some data in session , but each and every request the session is coming as a new session , so i am unable to retrieve the session data . I have tried with cookies , for cookies also i am facing the same problem. I have searched in google, i didn't find any solution . Kindly suggest me friends how to handle this situation.

Thanks in Advance,
Siva kumar.
sourabh girdhar
Ranch Hand

Joined: Feb 10, 2010
Posts: 71

You have posted the question in wrong forums.. Put it in web develpment forums , not in JDBC forums.


SCJP SCWCD AIX SOA
The significant problems we face cannot be solved by the same level of thinking that created them -- Albert Einstein

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You can't share a session between applications. You either need to pass the data you need with the request or persist this data somewhere both applications can access, such as a database.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
siva kumarl
Greenhorn

Joined: Nov 29, 2008
Posts: 21
Hi Sourabh,

Thanks for your reply, I am not sharing the session , i have included the application in IFRAME , it is just like a open application in seperate browser , the request coming from IFRAME is resetting every time means it is just like a new session or new request. So i need the synchronize the session/request.

Thanks in Advance,
Siva kumar.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61300
    
  66

As Paul has already told you, the session cannot be shared between two different web applications regardless of whether you are using iframes or not.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
siva kumarl
Greenhorn

Joined: Nov 29, 2008
Posts: 21
Hi Bear,
But session sharing is working in some systems in IE browser. As per your statement it should not work in all the systems , i doesn't understand why it is happening so . Do you have any idea regarding this , and one more thing i am not sharing the session between the two applications . I am using the session of same application .

Thanks in Advance.
Siva Kumar.

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

So the source of your IFrame is the same application? I thought you said "two applications"? Which statement is correct?

siva kumarl
Greenhorn

Joined: Nov 29, 2008
Posts: 21
Source is different application. I think source is not a matter, whenever IFRAME point to application , session will intiate and if user gives the request on the rendered application again the session is intiating as new session . This is the exact problem.


Thanks in Advacne.
Siva kumar.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Which session? The HTTP Session associated with the request to the application that includes the iframe will not change, regardless of what the source of the iframe is. The session associated with the request made from the iframe to the other application (defined as the source of the iframe) is completely unrelated to the first session.
siva kumarl
Greenhorn

Joined: Nov 29, 2008
Posts: 21
Hi Paul,
I hope you understand almost my problem , yes exactly correct what you have mentioned , but the HTTP session associated with the request to the application that includes in the iframe is changing every time . I doesn't understand why it's happening so. And this is working for some systems and not for some systems.

Thanks in Advance,
Siva kumar.
 
 
subject: Session problem with IFRAME