Updating a session variable on a page that uses enablesessionstate=readonly attribute doesn't fail f

Posted by chandmk on Stack Overflow See other posts from Stack Overflow or by chandmk
Published on 2010-06-13T02:08:25Z Indexed on 2010/06/13 2:12 UTC
Read the original article Hit count: 255

Filed under:

Asp.Net allows you you set the session state to readonly at individual page level or in the web.config for all pages.

But it doesn't prevent you from creating a brand new session variable on that page or modify an existing session variable. But when you try to use that session variable it is either not available or its value is not modified.

Why wouldn't the asp.net framework throw a run time error, if not compile time error, when a write attempt is made to a session on the pages where that is not allowed?

© Stack Overflow or respective owner

Related posts about ASP.NET