/    Sign up×
Community /Pin to ProfileBookmark

Servlet Session help

Alright I have an interesting problem,
I have an XML Request on a page that I’m building, on the server-side I would like to check and see if the Session gets invalidated to do some graceful browsing redirects since the application has the possiblity of multiple windows.

That isn’t hard at all, but what I’m curious about is if I can keep the request running (via sleep()) and keep checking to see if the Session gets invalidated so that I can do some things on the client side in case the user logs out.

When I was testing this out, I saw that even if I invalidated a Session in one thread, the others still held a copy of the Session before it was invalidated. So is there anyway I can request a copy of the main session object again since request.getSession() gives a copy of the session when the request was created?

Also is there a way to make a particular request not count towards keeping a session object alive (ex ajax requests with no user interaction)?

to post a comment
Java

1 Comments(s)

Copy linkTweet thisAlerts:
@SelrachauthorDec 13.2005 — Well it seems as if I was incorrect in my first assertion that the session does not get invalidated if you sleep the request. It does...it was simply my front end that was not cooperating.

If anyone has any answers about not letting a request count towards keeping a session object alive, I would appreciate it.
×

Success!

Help @Selrach spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...