By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,458 Members | 1,294 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,458 IT Pros & Developers. It's quick & easy.

Reading/Writing Session variables from a Static class

P: n/a
I'm having a strange problem possibly with Session variables for one
user being accessed by another.

I use a static utility class with static methods which get and set
certain Session variables. For Example:

public static string UserEmail
{
get { return HttpContext.Current.Session["email']; }
set { HttpContext.Current.Session["email"] = value; }
}

But, user A making this call was able to get back the email session
object for user B.

I would think that no matter how many users are using the static class,
they all get and set their own session variable "email".
Since I'm not storing the Session info in the static method but just
grabbing it. This should work, right?

Thanks

Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 1/25/2005 3:02 PM, al**********@gmail.com wrote:
I'm having a strange problem possibly with Session variables for one
user being accessed by another.

I use a static utility class with static methods which get and set
certain Session variables. For Example:

public static string UserEmail
{
get { return HttpContext.Current.Session["email']; }
set { HttpContext.Current.Session["email"] = value; }
}

But, user A making this call was able to get back the email session
object for user B.

I would think that no matter how many users are using the static class,
they all get and set their own session variable "email".
Since I'm not storing the Session info in the static method but just
grabbing it. This should work, right?

Thanks


Don't have an answer, but yes it should. I've done this before myself,
where you're creating a 'session utility' class....

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.