public String getUserId ( HttpServletRequest request ) { HttpSession session = request . getSession ( ) ; return ( String ) session . getAttribute ( "userId" ) ; }
Get the current user s ID from the session