If you get this error you have probably forgot to set up your session state in the forms configuration:

image

or you have not set up your share service provider correctly. Happened to me today! :)