If the code that was given does not have any effect I'm not sure what else you could try. The problem is that it is not known why the session is being cleared. If the reason for the session being cleared were known you might be able to do something to deter it. As it is now it is just a game of guess and check and I have run out of guesses myself.
Is this a problem that you can reproduce yourself? It might be worth trying the exact same thing as the user who is reporting the problem and see if you can get the same result. If you cannot get the same result it might be possible that it is a client side issue of some type.