How to access Session in .ashx file?

In the ashx.cs file, also “implement” the interface System.Web.SessionState.IReadOnlySessionState or System.Web.SessionState.IRequiresSessionState.

You don’t have to implement any method, just the presence of this makes the Session available (in readonly or read/write mode), through context.Session.

The header would look like:

public class MyHandler: IHttpHandler, System.Web.SessionState.IReadOnlySessionState

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)