Hello,
I'm experiencing an issue with DNN 7.2.2.
Steps to reproduce:
- Open the DNN site in a browser without being authenticated (let's call this window "A")
- Now locate any link that brings you to a different page within the same site but open it on a new window (right click, Open in a new window, etc). Now you have two browser windows with the same session, let's call the last one "window B"
- In window B authenticate yourself using the standard DNN control.
- Now, on window A press any button that makes a postback (HTTP Post). Please note if you make a GET request it will work, it has to be a post.
- You should see a 500 Internal server error (error in log refers to Invalid Viewstate, please see full error at the bottom of this post)
This issue was solved in the past disabling "view state mac validation" but latest asp .net changes pushed by Windows Update had forbidden this and make the validation mandatory.
http://blogs.msdn.com/b/webdev/archive/2014/09/09/farewell-enableviewstatemac.aspx
https://technet.microsoft.com/library/security/2905247
So, the question is how to solve the above issue? I tried to implement tips and advices on how to resolve this without any luck.
- I'm using IIS 7.5
- I'm not in a web farm
- I've tried pretty much everything advised here: http://support2.microsoft.com/kb/2915218
- Setting LoadUserProfile = true for the AppPool
- Setting machineKey in web.config file
- etc
You could ask what kind of valid scenario would involve authenticating in a separate browser window. Well, my scenario is different: I have a component with some buttons, if the user is not authenticated when pressing the button a SignIn popup is displayed with usual login component. After successful authentication the popup is closed and the same button is pressed again through javascript (I call __doPostBack, etc). The problem here is that the popup is a Telerik RadWindow that basically creates a window-like div with an IFrame and the IFrame loads the sign in component. Technically speaking that IFrame is pretty much the same as having a second page.
The above example having 2 opened pages is just the minimal and most straight forward way I've found of describing the problem.
Any ideas?
Thanks in advance for your help
In the logs:
2014-10-06 17:26:13,371 [SITE][Thread:43][ERROR] DotNetNuke.Services.Exceptions.Exceptions - DotNetNuke.Services.Exceptions.PageLoadException: 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.
See http://go.microsoft.com/fwlink/?LinkID=314055 for more information. ---> System.Web.HttpException: 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.
See http://go.microsoft.com/fwlink/?LinkID=314055 for more information. ---> System.Web.UI.ViewStateException: Invalid viewstate.
Client IP: 192.168.2.192
Port: 5724
Referer: http://www.site.com/TestPage.aspx
Path: /Default.aspx
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
ViewState: /wEPDw etc ...
--- End of inner exception stack trace ---
at System.Web.UI.ViewStateException.ThrowMacValidati (Exception inner, String persistedState)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString, Purpose purpose)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter2 formatter, String serializedState, Purpose purpose)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadAllState()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---