public boolean checkSession(xAuthPlayer player) {
		if (!plugin.getDbCtrl().isTableActive(Table.SESSION))
			return false;

		Connection conn = plugin.getDbCtrl().getConnection();
		PreparedStatement ps = null;
		ResultSet rs= null;

		try {
			String sql = String.format("SELECT `ipaddress`, `logintime` FROM `%s` WHERE `accountid` = ?",
					plugin.getDbCtrl().getTable(Table.SESSION));
			ps = conn.prepareStatement(sql);
			ps.setInt(1, player.getAccountId());
			rs = ps.executeQuery();
			if (!rs.next())
				return false;

			String ipAddress = rs.getString("ipaddress");
			Timestamp loginTime = rs.getTimestamp("logintime");

			boolean valid = isSessionValid(player, ipAddress, loginTime);
			if (valid)
				return true;

			deleteSession(player.getAccountId());
			return false;
		} catch (SQLException e) {
			xAuthLog.severe(String.format("Failed to load session for account: %d", player.getAccountId()), e);
			return false;
		} finally {
			plugin.getDbCtrl().close(conn, ps, rs);
		}
	}