This code basically shows how to implement a simple XML database to validate user logins
If you choose to implement a simple XML database for you users usernames and passwords.

Consider an xml file of the following format

    <john role="admin">pass1</john>
    <jen role="user">pass2</jen>
    <joey role="user">pass3</joey>

Note: These passwords normally have to be encrypted, we left it so for simplicity.

Your is function will look something like this

Function IsValidUser(usr, pwd)
    'reset all variables
    IsValidUser = False
    Session("UserRole") = ""

    'On Error Resume Next
    Dim xmldoc, nodeList, node
    Set xmldoc = Server.CreateObject("Microsoft.XMLDOM")
    xmldoc.async = False


    If xmldoc.parseError.ErrorCode=0 Then
        Set nodeList = xmldoc.documentElement.getElementsByTagName(usr)
        If nodeList.length>0 Then
            If nodeList.Item(0).Text = pwd Then
                IsValidUser = True
                On Error Resume Next
                Session("UserRole") = nodeList.Item(0).attributes.getNamedItem("role").nodeValue
                If Err.Number<>0 Then
                    Session("UserRole") = "GUEST"
                End If
            End If
        End If
    End If

xmldoc = Nothing
End Function