Testing a session ID

1
0

Hello,

 

How can I test if a SessionId is still valid ?

 

TIA

Mirko

  • You must to post comments
0
0

To fix the compiler error, you have to add a reference to System.Runtime.Caching assembly in the project.

  1. Right-click your project → Add → Reference…
  2. Go to Assemblies → search for System.Runtime.Caching
  3. Check it → OK

OR simply add this code to your .csproj file:

<ItemGroup>
<Reference Include="System.Runtime.Caching" />
</ItemGroup>

  • You must to post comments
0
0

Hello Julie,

Thanks for your quick answer. When I try to code something like if (System.Runtime.Caching.MemoryCache.Default.Get(mySessionId)==null) the compiler says that Caching doesn’t exist in System.Runtime. The funny thing is that if I test this in the quickWhatch at runtime it words indeed.

The application I’m working with creates some directories on the disc with the sessionId as name for working purposes. I now would like to destroy those directories if the session ID is no longer valid. How can I distiguish invaid ones from the ones still in use ?

 

TIA

Mirko

 

  • You must to post comments
0
0
Showing 3 results
Your Answer

Please first to submit.