2👍
✅
use self.request
anywhere in the class based view. In your case self.request.session
def get_context_data(self, **kwargs):
session = self.request.session
# now use session however you want
context = super(part_list_view, self).get_context_data(**kwargs)
context['my_list'] = populate_nav_bar()
return context
Source:stackexchange.com