开发者

Forms authentication on different hostings

开发者 https://www.devze.com 2022-12-19 20:32 出处:网络
Hi have form authenticaion for my site, and it works fine on localhost and godaddy, but after moving to another开发者_开发问答 hosting it stop working.

Hi have form authenticaion for my site, and it works fine on localhost and godaddy, but after moving to another开发者_开发问答 hosting it stop working. After login in admin area after 2-3 minutes I redirecting back to login screen. Does anybody know if I change some settings on IIS or what is the source of the problem? My code looks like

<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="10000" slidingExpiration="true"/>
</authentication>


FormsAuthentication.SetAuthCookie(userName, rememberMe);


If your application domain is being shut down and you have no machineKey section in Web.config (or validationKey/decryptionKey="AutoGenerate") you will get new validationKey/decriptionKey after every application start and authentication cookies will become invalid. Visit http://aspnetresources.com/tools/keycreator.aspx and add generated machineKey section into your Web.config.

0

精彩评论

暂无评论...
验证码 换一张
取 消