How to access Session values from layers beneath the web application layer.
Posted
by Matthew Vines
on Stack Overflow
See other posts from Stack Overflow
or by Matthew Vines
Published on 2010-04-23T22:52:36Z
Indexed on
2010/04/23
22:53 UTC
Read the original article
Hit count: 234
We have many instances in our application where we would like to be able to access things like the currently logged in user id in our business domain and data access layer. On log we push this information to the session, so all of our front end code has access to it fairly easily of course. However, we are having huge issues getting at the data in lower layers of our application. We just can't seem to find a way to store a value in the business domain that has global scope just for the user (static classes and properties are of course shared by the application domain, which means all users in the session share just one copy of the object). We have considered passing in the session to our business classes, but then our domain is very tightly coupled to our web application. We want to keep the prospect of a winforms version of the application possible going forward.
I find it hard to believe we are the first people to have this sort of issue. How are you handling this problem in your applications?
© Stack Overflow or respective owner