my dog learned polymorphism*
The moose likes JSP and the fly likes Is this a session issue ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Is this a session issue ?" Watch "Is this a session issue ?" New topic
Author

Is this a session issue ?

Ian Shieh
Greenhorn

Joined: Feb 04, 2010
Posts: 7
Hello, glad to join this forum..

I have a JSP including a <iframe> in the middle of page. On top of page there are some links linking to different site. When click one link, the content is displayed in the <iframe> underneath the links.

<iframe src="...">

When I clicked one link that goes to a web app in a different server, I got the page displayed in the iframe. However, after that whatever link I click, I found I can not see the page because the variables and credentials saved in session are all gone and I got session error page. Note: when I click the link for the first time, I still got everything. But after that, whatever link on the page i click, I was directed to the login page showing no session found.

what could be wrong for that link ? why did it work everytime when I click it for the first time ? but fails afterwards immediately ?
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Welcome to javaranch

You can use a session listener to find out if your session actually times out. Bind some keys to the listener and write some test code.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Ian Shieh
Greenhorn

Joined: Feb 04, 2010
Posts: 7
it is not session timeout issue. I set session time out to 30 mins. I only waited for one second before I click the next one.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

I am not saying it is, but you can use that technique to rule out the possibility.

Another way you can check for session loss is to look at your server's active sessions page (if it provides you one).
Ian Shieh
Greenhorn

Joined: Feb 04, 2010
Posts: 7
As a follow up, I found that

1) if I use "localhost" in the "src" link for iframe, it has the session lost problem
2) if I use my IP address in the "src" link for the iframe, the problem disappear.

Don't know why ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is this a session issue ?