I need help with a checkIn checkOut time registration button.

Vote:
 

Hi!

I am struggeling with some functionality I am trying to build. I will try to describe it as good as I can.

I am building a checkIn and checkOut button for a time registration application, on our intranet, so that employees can checkin/checkout from the intranet website and not have to navigate to the time registration website to checkin/checkout there. So I managed to create the functionality to checkin and out with AJAX requests to the time registration app. Now I am trying to make the intranet remember if an employee has checkedin or -out, so that the intranet does not spam the time registration app with requests while they navigate the intranet.
My idea was/is to make a controller which sets and gets a session variable with the checkedIn & -Out state so that the intranet checks the session if this is true and than does not have to send requests to the time registration app. I have made the controller and I am able to do an AJAX request with a simple "Hello world" answer, but when I try to use HttpContext.current.session in the controller I always get the exception "Object reference not set to an instance of an object".
After searching the internet for a while I found out/I think that it gives this exception because the session is not set/startet in the controller. I tried several things to "get the session startet" but with no succes.
Is here somebody who can help / point me into the right direction? Or maybe I should approach this completely different? I am open for suggestions :)

The checkIn-Out button is shown in a toolbar that hovers on the left side of the intranet website. The toolbar is always shown, on every page.

Let me know if you need more information to make it more clear!

Thanks, Rob

#256156
Jun 07, 2021 10:11
Vote:
 

Are you sure that session is turned on in web.config?

What does it mean for a user to check-in or check-out? Are you sure session is the right persistence for that?

#265056
Oct 14, 2021 7:36
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.