gdubs
gdubs

Reputation: 2754

MVC 3.0 formsauthentication authenticates in localhost server, but not on the webhost

So I'm getting some problem similar to this:

ttp://stackoverflow.com/questions/3694475/asp-net-forms-authentication-authenticates-in-localhost-server-but-not-on-the-w

but I'm using MVC 3.0 instead of web forms. Basically, i would log in and after clicking for a few seconds it would redirect me to the login page again. This happens after i publish the site onto my webhost, but on my localhost it works just fine. At first I thought it would be cuz of the timeout on the web.config, but it still has the default 2880. So I scratched that out.

Anybody experienced such problem before??

EDIT:

Saw some recommendations regarding generating a Machine Key for the application to prevent App Pool recycling. was wondering as to how i can generate that? i dont think i have access to the iis from my webhost(arvixe).

http://forum.winhost.com/showthread.php?t=8407

Upvotes: 0

Views: 322

Answers (1)

gdubs
gdubs

Reputation: 2754

So i figured it out and it stopped logging me out .. for now at least.

Apparently a machine key is needed so application would know if the cookie is going to use the same authentication. I just generated a machine key and placed that on my webconfig

eg:

<configuration>
    <system.web>
        <machineKey decryption="AES" decryptionKey="C03B1AB0BC1ACCD18EA915CBD87373010AD0DEC430A69871,IsolateApps" validation="AES" validationKey="C0ED7C430148AD4BC6505085DA4FD0DD3EE2453B566FC4EA4C7B3C2DCAB2025A79C774370CA884DF909CE9A3D379E544B7890D0A1CEE164141D3A966999DC625,IsolateApps" />
    </system.web>
</configuration>

so yeah, that worked, i hope it stays like that.

thanks everyone for the replies!

Upvotes: 1

Related Questions