After upload to Server, the site keeps logging me out

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
Hi

After upload to my server the website appears to be working fine except that it keeps redirecting me back to the login.aspx page after a few moments (for example http://www.emason.co.za/Login.aspx?ReturnUrl=%2fAdministration%2fCustomers.aspx), it is also not any particular time frame. Sometimes it works for 4 minutes and sometimes 10 seconds. btw my site is working perfect when it is running locally and using the online DB.

It initially appeared to be a session issue and set my session time longer on my hosting server. Still the same keeps happening.

I have been struggling to debug this issue for a couple of days now with no success.

Does anyone perhaps know what can be done to resolve it?

Help will be appreciated.
14 years ago
Have you changed this line in your web.config. Make sure you have the formsname to something unique.

    <authentication mode="Forms">
      <forms name="NOPCOMMERCE.AUTH" loginUrl="~/Login.aspx" protection="All" timeout="43200" path="/" requireSSL="false" slidingExpiration="true" defaultUrl="~/default.aspx" enableCrossAppRedirects="false"/>
    </authenticatio
14 years ago
Thanks for speedy reply

Okay i have installed a fresh web site on www.rkwc.co.za using the orginal source on the download. It still does the same thing.

any other suggestions
14 years ago
Phew, I finally figured out what the probelm was.. I dont know why i am the only one suffering from this issue.

Firstly i had this problem

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

Then i made a cardinal error.

I changed <pages EnableViewStateMac = "false"/> in my web config which takes the error away but create massive problems elsewhere.. For some reason whenever the viewstate creates an error, it logs you out.

The correct fix would be the following :

Generate your machine key at http://www.orcsweb.com/articles/aspnetmachinekey.aspx

Modify the web.config file to

<?xml version="1.0"?>

<configuration>

    <appSettings/>
    <connectionStrings/>
    <system.web>

        <machineKey validationKey='4XXXXABBECEAAD1E5C5BC0791ED5AB9A2CB4BE34D24BFAE882E295279A339F8069E02CC0AA2C3C871928ABD0C30019ADC5E064D24C48D95C72614C2ACFD99D' decryptionKey='B7420221667B35322DB8602DB91D25AB623F76C7D66B998E' validation='SHA1'/>

    </system.web>
</configuration>


There you have it. You have cured your view state errors.
14 years ago
Did this fixt the timeout issues also?
14 years ago
Yes, the timeout issue was caused by the Session that was terminated by the view state error.

As far as i understand it the Sever cannot validate the Machine key causing the Server to eliminate the session once the error occurs.
11 years ago
Creating a machineKey didn't work for me. Any other suggestions.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.