seting Session expiry time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sazan
    New Member
    • Apr 2010
    • 1

    #1

    seting Session expiry time

    Hi,

    I am new in java, i needed help in setting the expiry time for the session. I need the session to expire after 3 minutes, then show a table of the pages i visited during the 3 minutes and also show how many time each page was visited.

    I would appreciate any help.

    Thanks.
    sazan.
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    Use a thread, and then use its join method. Create a custom thread class, and put your pre-work in it's the run function.
    Code:
    Thread task = new CustomThread();
    task.start(); // calls the run() function.
    
    task.join(180000); // wait 180k ms = 180 s = 3 min
    
    Calculate stats here.
    Admittedly, I am weak in threading, so this may not be the best way to do it.

    Comment

    Working...