Password Salting & Auth Session

Password Salting
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.
password.PNG
AUTH Session
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.
auth.PNG

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.