Changeset 33083

Show
Ignore:
Timestamp:
16.05.2019 14:37:59 (5 weeks ago)
Author:
kjdon
Message:

changed uid to equal session id, instead of incremented integer. As incremented integer doesn't work if you save session state between tomcat restarts.

Files:
1 modified

Legend:

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

    r32939 r33083  
    9292     */ 
    9393    protected GSParams params = null; 
    94  
    95     /** 
    96      * user id - new one per session. This doesn't work if session state is 
    97      * saved between restarts - this requires this value to be saved too. 
    98      */ 
    99     protected int next_user_id = 0; 
    10094 
    10195    /** 
     
    449443        HttpSession session = request.getSession(true); 
    450444        session.setMaxInactiveInterval(session_expiration); 
    451         String uid = (String) session.getAttribute(GSXML.USER_ID_ATT); 
    452         if (uid == null) 
    453         { 
    454             uid = "" + getNextUserId(); 
    455             session.setAttribute(GSXML.USER_ID_ATT, uid); 
    456         } 
     445        String uid = session.getId(); 
    457446 
    458447        request.setCharacterEncoding("UTF-8"); 
     
    11591148    } 
    11601149 
    1161     synchronized protected int getNextUserId() 
    1162     { 
    1163         next_user_id++; 
    1164         return next_user_id; 
    1165     } 
    1166  
    11671150    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
    11681151    {