Changeset 14539

Show
Ignore:
Timestamp:
18.09.2007 16:16:23 (12 years ago)
Author:
shaoqun
Message:

fix the session bug

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/LibraryServlet.java

    r14524 r14539  
    304304     
    305305    HttpSession session = request.getSession (true); 
     306    session.setMaxInactiveInterval(session_expiration); 
    306307    String uid = (String)session.getAttribute (GSXML.USER_ID_ATT); 
    307308    if (uid ==null) { 
     
    350351            //logger.info("clear cache for the whole site."); 
    351352            session_ids_table = new Hashtable();  
    352              
     353            session.removeAttribute(GSXML.USER_SESSION_CACHE_ATT); 
    353354        } else { 
    354355            //clean up all cache info related to the collection 
     
    400401            session_cache = new UserSessionCache(sid, param_table); 
    401402            session_ids_table.put(sid, session_cache); 
     403        session.setAttribute(GSXML.USER_SESSION_CACHE_ATT, session_cache); 
    402404            //logger.info("new session id"); 
    403405        } 
     
    480482        } 
    481483      } 
    482          
    483       //now set the UserSessionCache object into the session with its life expectancy 
    484       if (session_cache != null) { 
    485           session.setAttribute(GSXML.USER_SESSION_CACHE_ATT, session_cache); 
    486           session.setMaxInactiveInterval(session_expiration); 
    487       } 
    488484    } 
    489485