“The form cannot be displayed because session state is not available” in SharePoint

Recently while configuring a custom workflow on a document library I was getting the following message “The form cannot be displayed because session state is not available.

And as a reason of the same I was not able to configure the workflow.

As the error message stated, the session state is not available. A quick look at the Site Collection web.config showed the following

As you can see in the above image, under httpModules the key “Session” with
type “System.Web.SessionState.SessionStateModule” was commented.

So after I uncommented the line and saved the file, the workflow worked like a charm.