Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6853957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:34:27+00:00 2026-05-27T01:34:27+00:00

I am trying to access to two websites simultaneously, both built using MVC. If

  • 0

I am trying to access to two websites simultaneously, both built using MVC. If Im logged In in one, I cant access the other. How can I correct the following?

I am having the error message:

Unable to validate data.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Unable to validate data.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Unable to validate data.]
System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean
fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length,
Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType,
Boolean signData) +4956871
System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean
fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length,
Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType)
+155 System.Web.Security.FormsAuthentication.Decrypt(String encryptedTicket) +283
MvcUI.MvcApplication.FormsAuthentication_OnAuthenticate(Object sender,
FormsAuthenticationEventArgs args) in
C:\Hg\MyProject\Code\MvcUI\Global.asax.cs:40
System.Web.Security.FormsAuthenticationModule.OnAuthenticate(FormsAuthenticationEventArgs
e) +11497690
System.Web.Security.FormsAuthenticationModule.OnEnter(Object source,
EventArgs eventArgs) +88
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+80 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237


New error message after inserting the same machine key for both apps

Value cannot be null.
Parameter name: value
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: value

Source Error:

Line 71: { Line 72: user =
myProject.API.User.Load(userName); Line 73:
HttpContext.Current.Cache.Add(key, user, null, System.Web.Caching.Cache.NoAbsoluteExpiration, Line 74: new
TimeSpan(0, 2, 0), System.Web.Caching.CacheItemPriority.Default,
null); Line 75: }

[ArgumentNullException: Value cannot be null.
Parameter name: value]
System.Web.Caching.CacheEntry..ctor(String key, Object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, Boolean isPublic) +8942559
System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key, Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace) +93
System.Web.Caching.Cache.Add(String key, Object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback) +81
MvcUI.MvcApplication.GetUserFromCache(String userName) in C:\Dev\myProject\Code\MvcUI\Global.asax.cs:73
MvcUI.MvcApplication.FormsAuthentication_OnAuthenticate(Object sender, FormsAuthenticationEventArgs args) in C:\Dev\myProject\Code\MvcUI\Global.asax.cs:40
System.Web.Security.FormsAuthenticationModule.OnAuthenticate(FormsAuthenticationEventArgs e) +9043237
System.Web.Security.FormsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs) +84
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


Global.asax.cs

public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        routes.IgnoreRoute("WebService/{*pathInfo}");

        routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
        );
    }

    public void FormsAuthentication_OnAuthenticate(object sender, FormsAuthenticationEventArgs args)
    {
        if (FormsAuthentication.CookiesSupported)
        {
            if (null != Request.Cookies[FormsAuthentication.FormsCookieName])
            {
                FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(Request.Cookies[FormsAuthentication.FormsCookieName].Value);
                args.User = new myProject.Web.UI.Classes.UserPrincipal(GetUserFromCache(ticket.Name));
            }
        }
        else
            throw new HttpException("Cookieless Forms Authentication is not supported for this application.");
    }

    public void WindowsAuthentication_OnAuthenticate(object sender, WindowsAuthenticationEventArgs args)
    {
        string username = args.Identity.Name.Substring(args.Identity.Name.IndexOf("\\") + 1);
        myProject.API.User user = GetUserFromCache(username);

        if (null == user)
            throw new HttpException("User could not be found.");

        args.User = new myProject.Web.UI.Classes.UserPrincipal(user);
    }

    protected void Application_Start()
    {
        AreaRegistration.RegisterAllAreas();

        RegisterGlobalFilters(GlobalFilters.Filters);
        RegisterRoutes(RouteTable.Routes);
    }

    private static myProject.API.User GetUserFromCache(string userName)
    {
        string key = "User " + userName;
        myProject.API.User user = (myProject.API.User)HttpContext.Current.Cache[key];
        if (null == user)
        {
            user = myProject.API.User.Load(userName);
            HttpContext.Current.Cache.Add(key, user, null, System.Web.Caching.Cache.NoAbsoluteExpiration,
                    new TimeSpan(0, 2, 0), System.Web.Caching.CacheItemPriority.Default, null);
        }

        return user;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:34:27+00:00Added an answer on May 27, 2026 at 1:34 am

    Thanks to all of you for having tried to reply to the question. Indeed they were all helpful. I solved the problem myself by adding a machinekey to the wenconfig, as well as a form name had to be there. without te form name, even the machine key was not useful

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to access a WCF web service, that is using two way
Using S#arp Architecture 2.3 RC , I am trying to publish two websites which
I'm trying to access my application's tables in Play! Framework, but I can't find
I'm trying to access data from two different databases inside a transactionscope. But while
Using NSURLRequest , I am trying to access a web site that has an
I am trying to access a nested field using gstring but it throws exception
I'm trying to publish my website to a local folder. I have two websites
I'm trying to add two extra config options to my application.rb so I can
I can't realize why do I have 404 error while trying to access /liginform.dlp
Im trying to access a web service from a remote computer. I managed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.