0

I am working on a MVC4 sub site that will only be accessible after login, the problem is that the authentication will be done on my main site (done in MVC3).

the main site stores the user data in :

Session["UsrData"]

to carry on with development of the sub site I want to be able to simulate a login and store user data provided by me programmatically of in a config file that will refer to a test user in the database.

how can I insert the test user data into the session?

mmilan
  • 1,738
  • 8
  • 31
  • 57
  • This might help http://stackoverflow.com/questions/3027264/mocking-user-identity-in-asp-net-mvc – Alex Nov 08 '13 at 13:31

1 Answers1

1

Since your main site processes the login for each user for testing purposes set the session data manually in your sub-site i.e. Session["Myvar"] and surround the hard wired session statements with #if DEBUG #endif

Mike Beeler
  • 4,081
  • 2
  • 29
  • 44