Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Orchard CMS module that uses HTTP session state

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

I've downloaded the Jumpstart module but have not been able to find any way to get access to the session in the handler or the driver.

Any help would be great.

like image 652
Jonathan Parker Avatar asked Feb 21 '23 02:02

Jonathan Parker


1 Answers

Simply inject IHttpContextAccessor into the constructor of your driver or handler. Then you can call accessor.Current() and get access to the Session

like image 95
rfcdejong Avatar answered May 10 '23 12:05

rfcdejong