Given below are the various differences.
SessionStorage – The data is stored for a particular session. The data will be lost whenever the browser tab will be closed or after some particular session. Maximum size stored can be up to 5MB.
Cookies – It stores the data that has to be sent back to the server with some requests. The cookie’s expiration varies on the type and duration set from either the server side or client side. Maximum size stored can be less than 4KB.