webforms - ASP.NET site auto-login during development -
while developing asp.net site, way setup automatic login?
for example, each time build site , run it, have login again. don't want disable security entirely, automate process of logging in while i'm working on site.
just keep browser open , ctrl+f5 after modify and/or recompile in visual studio. keep authentication cookie.
another possibility setup automatic login page in test whether in debug mode , force login using formsauthentication.redirectfromloginpage("someusername", false);
. instruct visual studio run web site @ url:
protected void page_load(object sender, eventargs e) { #if debug formsauthentication.redirectfromloginpage("someusername", false); #endif }
ideally page should excluded build process , never shipped.
as pointed out in comments section @mufasa if site uses session might need use out of process mode (stateserver or sqlserver) instead of inproc
because when recompile application domain reloaded , stored in memory lost.
Comments
Post a Comment