[#31561] Add support for BCrypt encryption of passwords and rewrite cookie based authentication to use it (Fix #2101)