Make a readonly session on asp.net programmatically (EnableSessionState = "ReadOnly")

I need to make a readonly session so that I can set multiple requests to a page using session variables, but in readonly mode.

Since the whole process is running on my server, I need a way to make the readonly session programmatically.

+5
source share
1 answer

Your script should have one page that can write in the session, and the other does not have the right to write on it. a page with write access to a session will contain a record lock in the session until the request is completed. The page gains write access to the session state by setting the EnableSessionState attribute in the @Page directive to True. A page that has read access to session state, for example, when the EnableSessionState attribute is set to ReadOnly, will hold the read lock in the session until the request completes.

<% @Page EnableSessionState="ReadOnly" %>

for more information you can read this link .

+3
source

All Articles