byte arrays using Encoding.UTF8.GetBytes(string). i convert a hash to its string representation it is use to Convert.ToBase64String and Convert.FromBase64String to convert it back.
This code hashes the password "Pa$$w0rd" using crypt and stores the result in the password Hash string variable.
I add AddDistributedMemoryCache, Add Session and Use Session but when page is requested.
I also check the value of the session key in all our secured page so that user does not simply type the secured page’s URL and access it.
In the Page Load event of all the secured pages, add the following code.