471,082 Members | 719 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,082 software developers and data experts.

Reading/Writing Session variables from a Static class

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
1 3657
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.

Similar topics

2 posts views Thread by adam | last post: by
6 posts views Thread by Just D | last post: by
15 posts views Thread by Jason | last post: by
9 posts views Thread by Randy | last post: by
2 posts views Thread by james | last post: by
1 post views Thread by cobus.lombard | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.