if (user != null) {\r
GitBlitWebSession session = GitBlitWebSession.get();\r
session.authenticationType = AuthenticationType.COOKIE;\r
+ logger.info(MessageFormat.format("{0} authenticated by cookie from {1}",\r
+ user.username, httpRequest.getRemoteAddr()));\r
return user;\r
}\r
}\r
} \r
\r
private void login() {\r
+ GitBlitWebSession session = GitBlitWebSession.get();\r
+ if (session.isLoggedIn() && !session.isSessionInvalidated()) {\r
+ // already have a session\r
+ return;\r
+ }\r
+ \r
// try to authenticate by servlet request\r
HttpServletRequest httpRequest = ((WebRequest) getRequestCycle().getRequest()).getHttpServletRequest();\r
UserModel user = GitBlit.self().authenticate(httpRequest);\r
\r
// Login the user\r
if (user != null) {\r
- // Set the user into the session\r
- GitBlitWebSession session = GitBlitWebSession.get();\r
// issue 62: fix session fixation vulnerability\r
session.replaceSession();\r
session.setUser(user);\r