check in function to sync localStorage and sessionStorage for small size storage data.
if the storage size is large, the function might be not working.