Error in saving data(input) to data sets(collections) after adding IF statement

Maybe the Session collection is set to read-only or limited to admin only. Check the permissions.