If the error you are getting is "Your session has timed out" , it could be because of the following :
a) check you setting in SIte Administration > Server > Session Handling. Increase the time in Timeout to above 1 hour.
b) Clear the cache of your browser. If you are able to login, always click on the logout button before closing moodle