I use the screen utility. Basically, I always have screen running, and the repl / vim running. With the repl running in screen you can detach via control-a d, and then log off, and the repl keeps on running. Then you ssh back in, and can reattach via screen -dr.
I haven't had any security concerns - I have a couple admin pages but of course one has to be an admin to see them.