As I said, my own answer and the explanation:
The problem is that the Session object is a non static member of the Page/Control class that I was using.
So I have to use:
static void testStaticFunc()
{
HttpContext.Current.Session["test"] = "testString";
}
And it works.
Thanks anyway.