{"id":23719508,"url":"https://github.com/appfigures/memcached-sessionstore","last_synced_at":"2026-02-12T02:30:14.988Z","repository":{"id":4495739,"uuid":"5635081","full_name":"appfigures/memcached-sessionstore","owner":"appfigures","description":null,"archived":false,"fork":false,"pushed_at":"2012-09-12T01:27:45.000Z","size":202,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-30T21:52:17.447Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appfigures.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-31T23:16:39.000Z","updated_at":"2014-01-02T15:28:55.000Z","dependencies_parsed_at":"2022-09-20T23:20:58.420Z","dependency_job_id":null,"html_url":"https://github.com/appfigures/memcached-sessionstore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfigures%2Fmemcached-sessionstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfigures%2Fmemcached-sessionstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfigures%2Fmemcached-sessionstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appfigures%2Fmemcached-sessionstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appfigures","download_url":"https://codeload.github.com/appfigures/memcached-sessionstore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239808684,"owners_count":19700490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-30T21:52:19.348Z","updated_at":"2026-02-12T02:30:14.945Z","avatar_url":"https://github.com/appfigures.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"### A .NET Session State Store Provider that uses Memcached. \n\nOut of the box .NET sessions are stored on the web server in memory, which is perfect for single-server environments. Load balanced environments with multiple servers however require a little more.\n\nThe alternatives:\n\n1. Use a database - Regardless of which database camp you're on, using it for this purpose is extremely inefficient and should not be deployed in any production environment.\n2. L7 load balance - Not extremely, but also inefficient. Requires special hardware. Prevents continuous balancing for a single user.\n\n[Memcached](http://memcached.org/) is an open-source distributed memory caching system that fits the bill perfectly:\n- It's lightweight\n- It's in-memory so it's fast\n- It's distributed and very easy to scale\n\n# Setup\n\n### Set up a Memcached server\n\nDuh. Many articles have been written about setting up Memcached. Use the one you like the most.\n\n### Add BeITMemcached to your project\n\nThe Memcached client used in this project is BeITMemcached. It's lean, fast, and easy to work with. \n\nA compiled version (dll) is included for simplicity and can be dropped into you /bin folder. The complete source is available on the project's homepage at http://code.google.com/p/beitmemcached/. Pick the way you like better and get BeIT into your project.\n\n### Set up a Memcached pool\n\nDefining a pool assigns one or more memcached servers a friendly name that can be used programmatically.\n\nAdd the following to your Global.asax file. Feel free to change _DefaultPool_.\n\n```\nvoid Application_Start(object sender, EventArgs e) {\n  BeIT.MemCached.MemcachedClient.Setup(\"DefaultPool\", new String[] { \"server:port\" });\n}\n```\n\n### Add the custom provider to your project\n\nAdd `MemcachedSessionStateStore.cs` and `LockInfo.cs` to your `App_Code` folder.\n\n### Register the provider\n\nUpdate the SessionState section of your Web.Config file as follows:\n\n```\n\u003csessionState customProvider=\"Memcached\" mode=\"Custom\" regenerateExpiredSessionId=\"true\"\u003e\n  \u003cproviders\u003e\n    \u003cadd name=\"Memcached\" type=\"MemcachedSessionStateStore\" ApplicationName=\"[application]\" description=\"\" pool=\"[pool]\"/\u003e\n  \u003c/providers\u003e\n\u003c/sessionState\u003e\n```\n\nWhere:\n- __[application]__ is a unique name for your application. This is used to ensure multiple applications can run on the same Memcached server.\n- __[pool]__ is the name of the pool you defined in the previous step.\n\nThat's it. Your sessions should now be stored in Memcached.\n\n# Warnings\n\n* Memcached was/is not really meant to run on Windows. While there are ways to set it up none are recommended for production environments. __Run your Memcached on Linux!__.\n* Memcached stores everything in memory which means a restart of the daemon or the server will result in the loss of all sessions. __If your application can't sustain such loss you'll need to find a more persistent place to store your sessions!__","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappfigures%2Fmemcached-sessionstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappfigures%2Fmemcached-sessionstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappfigures%2Fmemcached-sessionstore/lists"}