Orchard CMS module that uses HTTP session state

I am trying to write a simple Orchard shopping cart module that will store items in session state and then read them when the user wants to check. It should work for anonymous users.

I downloaded the Jumpstart module, but could not find a way to access the session in the handler or driver.

Any help would be great.

+4
source share
1 answer

Just add IHttpContextAccessor to the constructor of your driver or handler. Then you can call accessor.Current () and access the session

+8
source

Source: https://habr.com/ru/post/1402083/


All Articles