Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to keep the session alive, when web app is inactive?

Reply
Thread Tools

How to keep the session alive, when web app is inactive?

 
 
aneta737@yahoo.com
Guest
Posts: n/a
 
      01-03-2006
Hello,

I have a web (Struts based) application which holds almost all info
about what user is logged in and what he was currently doing in a
session.

Once the session expires, all info is lost and users get errors... so
they have to re-open the application and re-login.

I have a Websphere timeout set to 30 mins (I can't change that). What
can I do to keep the session ALIVE when the user is not using the
application?

I have heard of Socket.keepAlive(true) method. Would that work for me?

Any help would be appreciated.

 
Reply With Quote
 
 
 
 
Comics
Guest
Posts: n/a
 
      01-03-2006
Can't change timeout in Web.xml?
So, use "timer/thread" to put something into session in certain interval.


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Hello,
>
> I have a web (Struts based) application which holds almost all info
> about what user is logged in and what he was currently doing in a
> session.
>
> Once the session expires, all info is lost and users get errors... so
> they have to re-open the application and re-login.
>
> I have a Websphere timeout set to 30 mins (I can't change that). What
> can I do to keep the session ALIVE when the user is not using the
> application?
>
> I have heard of Socket.keepAlive(true) method. Would that work for me?
>
> Any help would be appreciated.
>



 
Reply With Quote
 
 
 
 
aneta737@yahoo.com
Guest
Posts: n/a
 
      01-03-2006
Actually, my application is using a common company API that controls
the login. I believe there are other INACTIVE settings that kill my
session.

What can I do to "pretent" that someone is working on the application,
i.e. gets or sends requests to/from the server.

I've read that Socket.keepAlive(true) will send the packet only after 2
hours. Is there something like that I could implement but I need to
send packets more often (less than 30 min)?

 
Reply With Quote
 
Abhijat Vatsyayan
Guest
Posts: n/a
 
      01-03-2006
What is wrong with method "setMaxInactiveInterval" ? This should
override any timeout specified in web.xml .

Abhijat

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Hello,
>
> I have a web (Struts based) application which holds almost all info
> about what user is logged in and what he was currently doing in a
> session.
>
> Once the session expires, all info is lost and users get errors... so
> they have to re-open the application and re-login.
>
> I have a Websphere timeout set to 30 mins (I can't change that). What
> can I do to keep the session ALIVE when the user is not using the
> application?
>
> I have heard of Socket.keepAlive(true) method. Would that work for me?
>
> Any help would be appreciated.
>

 
Reply With Quote
 
Bruce Lewis
Guest
Posts: n/a
 
      01-03-2006
(E-Mail Removed) writes:

> I have a web (Struts based) application which holds almost all info
> about what user is logged in and what he was currently doing in a
> session.


That's precisely your problem. The only info that should ever go in a
session variable is info that can be easily reconstructed or info you
don't care about.

Your login system should be able to reauthenticate a user no matter what
they're doing.

Info about what a user is currently doing belongs in URLs or hidden form
variables. The side that cares about the info is the one that should
keep it.

There's a reason why statelessness on the server side is one of the
bragging points of HTTP.

--

http://ourdoings.com/ Easily organize and disseminate news and
photos for your family or group.
 
Reply With Quote
 
isamura
Guest
Posts: n/a
 
      01-04-2006
<(E-Mail Removed)> wrote ...
: Hello,
:
: I have a web (Struts based) application which holds almost all info
: about what user is logged in and what he was currently doing in a
: session.
:
: Once the session expires, all info is lost and users get errors... so
: they have to re-open the application and re-login.
:
: I have a Websphere timeout set to 30 mins (I can't change that). What
: can I do to keep the session ALIVE when the user is not using the
: application?
:
One approach may be provide a link to a keepSessionAlive.jsp page where the page automatically
refreshes at regular interval. Of course this page will have to "live" in a separate tab or window.

..k


 
Reply With Quote
 
Robert
Guest
Posts: n/a
 
      01-04-2006
I second isamura. We use the XMLHttpRequest to keep the app in
constant contact with the server, about every minute or so as long as
the window stays open. As soon as someone closes the app they drop
their session but if they leave the window open all day and don't log
out their session lives on and they can come back to it whenever. The
only time this is a problem is when the users do a task that takes a
long time for a page refresh and it occassionally times out.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
How to provide credentials to a web app from an external web app? rpfe@sapo.pt ASP .Net 1 02-09-2007 05:06 PM
convert java web app 2 .NET web app =?Utf-8?B?bml6YW0=?= ASP .Net 0 02-28-2006 04:46 AM
convert java web app 2 .NET web app =?Utf-8?B?bml6YW0=?= ASP .Net 0 02-28-2006 04:45 AM
How to secure one web app with another web app... Maras ASP .Net Security 0 06-17-2004 07:37 AM



Advertisments