I forgot to mention something VERY important (sorry I was in a rush :p), my code is in a WebUserControl in a WebPart in Sharepoint (wss 3.0 with ajax enabled). Is in the CreateChildControls method of the webpart tha the error occurs. The same error occurs when there's a redirect, but the session variables are not lost. Something I found out is that the error is related to files of certain size. I successfully uploaded several files of 168KB and smaller, but with files from 202KB and bigger, the session variable is cleared.
And nope, I'm not using Response.End() :)
Any ideas?