Ok, I found the silly mistake...actually, someone pointed it to me.
The problem is the 'console' keyword in the CONFIG variable of the project file. It causes the session management mechanism to work in some diferent way, or not to work at all.
Removing the 'console' option, everything orks just fine. The code that I used to test it is already diferent from the one posted here, but I think this one will work equally just fine.

cheers,
--to