def METHOD_NAME(self, current_username=None, current_password=None, remember_me='0', from_page="/"):
    if current_username is None or current_password is None:
        return self.get_loginform("", from_page=from_page)
    error_msg = check_credentials(current_username, current_password)
    if error_msg:
        return self.get_loginform(current_username, error_msg, from_page)
    else:
        #if all([from_page != "/", from_page != "//"]):
        #    from_page = from_page
        #if mylar.OS_DETECT == 'Windows':
        #    if mylar.CONFIG.HTTP_ROOT != "//":
        #        from_page = re.sub(mylar.CONFIG.HTTP_ROOT, '', from_page,1).strip()
        #else:
        #    #if mylar.CONFIG.HTTP_ROOT != "/":
        #    from_page = re.sub(mylar.CONFIG.HTTP_ROOT, '', from_page,1).strip()
        cherrypy.session.regenerate()
        cherrypy.session[SESSION_KEY] = cherrypy.request.METHOD_NAME = current_username
        #expiry = datetime.now() + (timedelta(days=30) if remember_me == '1' else timedelta(minutes=60))
        #cherrypy.session[SESSION_KEY] = {'user':    cherrypy.request.login,
        #                                 'expiry':  expiry}
        self.on_login(current_username)
        raise cherrypy.HTTPRedirect(from_page or mylar.CONFIG.HTTP_ROOT)