Is it safe to access asp.net session variables through static properties of a static object?

Posted by Ronnie Overby on Stack Overflow See other posts from Stack Overflow or by Ronnie Overby
Published on 2010-05-10T16:08:23Z Indexed on 2010/05/10 16:14 UTC
Read the original article Hit count: 263

Filed under:
|
|
|
|

Is it safe to access asp.net session variables through static properties of a static object?

Here is what I mean:

public static class SessionHelper
{
    public static int Age
    {
        get
        {
            return (int)HttpContext.Current.Session["Age"];
        }

        set
        {
            HttpContext.Current.Session["Age"] = value;
        }
    }


    public static string Name
    {
        get
        {
            return (string)HttpContext.Current.Session["Name"];
        }

        set
        {
            HttpContext.Current.Session["Name"] = value;
        }
    }
}

Is it possible that userA could access userB's session data this way?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about .NET