-
Jun 24th, 2023, 06:10 AM
#1
Thread Starter
Frenzied Member
Keep Session alive in ASP.NET Core Web API
Hello Everybody,
I have a web api project developed in asp.net core that has a bunch of api functions. Each function connects to the hsm, does something and logs out of the hsm. What I need to do is to create the hsm connection once in the start of the application somewhere and keep using the connection in every api function. Is this possible?
Thanks,
Muhammad Usama Alam
-
Jul 30th, 2023, 12:22 PM
#2
Re: Keep Session alive in ASP.NET Core Web API
 Originally Posted by usamaalam
Each function connects to the hsm, does something and logs out of the hsm.
Muhammad Usama Alam
What's the hsm?
-
Jul 30th, 2023, 02:27 PM
#3
Re: Keep Session alive in ASP.NET Core Web API
 Originally Posted by usamaalam
Hello Everybody,
I have a web api project developed in asp.net core that has a bunch of api functions. Each function connects to the hsm, does something and logs out of the hsm. What I need to do is to create the hsm connection once in the start of the application somewhere and keep using the connection in every api function. Is this possible?
Thanks,
Muhammad Usama Alam
Would this connection to the HSM need to be done on a per user basis, or just once for the application? If it is just once you could probably open the connection on launch and then store it somewhere like either in a cache, or possibly create a singleton object.
Is there a reason why you need to maintain a single connection, rather than opening and closing a connection on each usage?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|