Long ago I was reading about Ernest Hemingway's approach to dealing with writer's block and one thing he said has stuck with me and proved quite successful for both "coder's block" and remembering where I left off from the last coding session:
I always worked until I had something done and I always stopped when I knew what was going to happen next. That way I could be sure of going on the next day…