File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Question on caching of page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Question on caching of page" Watch "Question on caching of page" New topic
Author

Question on caching of page

Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585
My pages are caching server side, I believe. here's what happens:
1. A person's session timesout
2. they try to access something and get kicked to log in page
3. they re-login, are authenticated and sent back to their home page
4. they click a link to go to the page they were on when the session timed out and it automatically acts as though they were still times out and kicks them to the log in page with the message that they were logged out!
What's going on?
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
it sounds as bad code. the jsp page will make a session check each time it requested... so it doesn't sound like a caching problem.. post your code here, we'll take look.


Asher Tarnopolski
SCJP,SCWCD
Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585

It prints out the correct typeID, name and first name, yet it will throw the error. It only happens after:
1. the session times out {correct action]
2. then I either try to refresh the page or click something
3. It sends me to the login page [still correct]
4. I re-login and it accepts and sends me to the home page [correct]
5. I click to go back to that original page and it kicks me to log in with the error [INCORRECT!]
Then no matter how many times I repeat #4-5 it keeps kicking me out, until I change something on that page's JSP AND try to go DIRECTLY there. Then it recompiles it and then I can go there. I'm completely stumped.
Bhupinder Dhillon
Ranch Hand

Joined: Oct 12, 2000
Posts: 124

Maybe the expression is returning false.
Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585
yeah, except I'm printing it out and it's exactly the same. I even put a print statement that tests those two and it's "true".
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
well, if you belive it's a matter of cache,
use
<% response.setHeader("cache-control","no-cache"); %>
<% response.setHeader("cache-control","no-cache"); %>
if this doesn't help- let's see all files in your entire authentication system. check if you don't remove an attribute from the session somewhere etc.etc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question on caching of page