PHP works on server side so It will not be able to login when user is offline. The caching is done only of output files such as
html,js,css,images
etc but Cookies
can not be edited*(actully they can be by javascript)* without connecting to server.