How can I keep my session going if I'm writing a long answer or an essay in Moodle?
Simple! Make a server request! How? By right clicking on a link or another class, and opening it in a New Tab or New Window. You don't have to use it, just let the server know you're still there and your two hour time out count down will be renewed.
The alternative is to write your reply in a word processor program. When it's ready to post, log into Moodle. Now copy and paste your reply into Moodle and submit it.