Working inside the context of an ASP.NET application, I create a page that can execute database scripts on one of the many databases in our environment. To do this, we need to ask the user for a combination of username and password, this value can be used for all servers without problems.
The question is, where is the safest place to store this information? We need to temporarily store it, as if they were on this particular page, they could execute hundreds of scripts using several postbacks. From what I can say, I have 3 options, and I'm not sure which is better. Below is my selection of options, what is the recommendation for everyone here? What is the safest, albeit user friendly?
Store Information in Viewstate
One of the first ideas we discussed was to store information after a user provides it to the ViewState for the page. This is useful because the information will only exist throughout the life of the page, but we are not sure about its consequences.
Save Session Information
The next idea that we had was to save it in a session, but the disadvantage of this is that the information may be available for other pages within the application, and the information is always delayed in memory on the server.
Save information in the application
The last idea we had was to store it in the application cache, with a specific user key and a 5-minute rolling expiration. It will still be available for other pages, but it will provide caching information for a shorter period.
Why?
Last important question: "Why are you doing this?". Why don't we just use their Lan id? Well, we cannot use lan id due to lack of network support for delegation.
S0 What is the recommended solution? What for? How safe is it, and can we be?
Update
A lot of information has been discussed. To clarify, we work in an intranet environment, we CANNOT use impersonation or delegation due to network restrictions.