T
Tilfried Weissenberger
Hi,
I have had a strange situation:
In a back-end DLL for a website I have a function which loads a
cart-object from a HttpContext.Session into a static variable in a
class and serves this object to the visiting user.
While this works fine, as long as the DLL itself resides in the /bin
directory of the web-application, the static object seems to be
globally available to ALL USERS, if I move the DLL to the GAL!
In fact, the whole application started to do wicked things as long as
the DLL(s) were in the GAL. If I moved them to the web-app's /bin
directory and removed the entries in the GAL, the app worked fine.
As I wish to fix the cause, not the symptoms, I apprechiate anyone
shedding any light into this problem.
That was my code:
private static BusinessCase DefCart;
public static BusinessCase GetDefCart(bool AutoCreate) {
if (DefCart != null) return DefCart;
HttpContext ctx = HttpContext.Current;
if (ctx == null) return null;
if (ctx.Session[""+Shop.SessVars.BCase] == null) {
if (AutoCreate)
DefCart = CreateNewDefCart();
else
return null;
} else
DefCart = (BusinessCase)ctx.Session[""+Shop.SessVars.BCase];
return DefCart;
}
regards
Tilli
I have had a strange situation:
In a back-end DLL for a website I have a function which loads a
cart-object from a HttpContext.Session into a static variable in a
class and serves this object to the visiting user.
While this works fine, as long as the DLL itself resides in the /bin
directory of the web-application, the static object seems to be
globally available to ALL USERS, if I move the DLL to the GAL!
In fact, the whole application started to do wicked things as long as
the DLL(s) were in the GAL. If I moved them to the web-app's /bin
directory and removed the entries in the GAL, the app worked fine.
As I wish to fix the cause, not the symptoms, I apprechiate anyone
shedding any light into this problem.
That was my code:
private static BusinessCase DefCart;
public static BusinessCase GetDefCart(bool AutoCreate) {
if (DefCart != null) return DefCart;
HttpContext ctx = HttpContext.Current;
if (ctx == null) return null;
if (ctx.Session[""+Shop.SessVars.BCase] == null) {
if (AutoCreate)
DefCart = CreateNewDefCart();
else
return null;
} else
DefCart = (BusinessCase)ctx.Session[""+Shop.SessVars.BCase];
return DefCart;
}
regards
Tilli