Can all switches state be remained when internet connection loss?

I do this by storing the state of each relay pin in a virtual pin ie every time I write to a physical pin I also write to a virtual pin whichis stored on server. On a reset or power loss etc I do a syn each virtual pin at start up and do the same to the digital pin therefore reinstating the status of each relay at time of failure

look through this

Cheers

kev