So I have built a couple web apps now and I'm not sure if my authentication method is the most secure.
I currently compare the username/password combination to the AD account and if the authentication is successful it creates a session string that contains the user id. Then on page load for every page that requires you to be logged in checks that session string to see if it is null or has a value. If it is null it redirects you to the log in page but if it is not null then it loads the page.
My question is if there is a better way to handle authentication than this? The way I have it currently built works but I'm curious to see if there is a better way to handle this.