List all active ASP.NET Sessions

You can collect data about sessions in global.asax events Session_Start and Session_End (only in in-proc settings): private static readonly List<string> _sessions = new List<string>(); private static readonly object padlock = new object(); public static List<string> Sessions { get { return _sessions; } } protected void Session_Start(object sender, EventArgs e) { lock (padlock) { _sessions.Add(Session.SessionID); } … Read more

Disable Session state per-request in ASP.Net MVC

If anyone is in the situation I was in, where your image controller actually needs read only access to the session, you can put the SessionState attribute on your controller [SessionState(SessionStateBehavior.ReadOnly)] See http://msdn.microsoft.com/en-us/library/system.web.mvc.sessionstateattribute.aspx for more info. Thanks to https://stackoverflow.com/a/4235006/372926

Sharing sessions across applications using the ASP.NET Session State Service

I did it this way: Basically the idea is both apps use native .net sessionState stored in sqlserver. By using the same machine key and making a small tweak to a stored procedure – both apps can share any session keys and/or forms authenication. Both apps would do something like this in their web.config: <sessionState … Read more

How can I check if a user is logged-in in php?

Logins are not too complicated, but there are some specific pieces that almost all login processes need. First, make sure you enable the session variable on all pages that require knowledge of logged-in status by putting this at the beginning of those pages: session_start(); Next, when the user submits their username and password via the … Read more

Why are there two incompatible session state types in ASP.NET?

In ASP.NET MVC abstractions over the classic HttpContext objects Request, Response, Session were introduced. They represent abstract classes and are exposed all over the MVC framework to hide the underlying context and simplify the unit testing because abstract classes can be mocked. For example for the session object you have HttpSessionStateBase and its implementation HttpSessionStateWrapper. … Read more

How can I disable session state in ASP.NET MVC?

You could make your own ControllerFactory and DummyTempDataProvider. Something like this: public class NoSessionControllerFactory : DefaultControllerFactory { protected override IController GetControllerInstance(Type controllerType) { var controller = base.GetControllerInstance(controllerType); ((Controller) controller).TempDataProvider = new DummyTempDataProvider(); return controller; } } public class DummyTempDataProvider : ITempDataProvider { public IDictionary<string, object> LoadTempData(ControllerContext controllerContext) { return new Dictionary<string, object>(); } public void … Read more

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