• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Question on caching of page

 
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Maybe the expression is returning false.
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ever since I found this suit I've felt strange new needs. And a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic