#author("2017-12-10T13:02:35+00:00","default:admin","admin") -[[ASP.NET COREでSessionState:http://blog.kokoni.jp/2017/05/25/asp-net-core%E3%81%A7sessionstate/]] -[[ASP.NET Core で複数Webサーバーでセッションを共有するときは、IDistributedCacheとIDataProtectionに注意しないといけない話:http://tech.tanaka733.net/entry/session-sharing-in-aspnetcore]] -[[ASP.NET Core MVCでTempData(Session)を使用する:http://blog.nakajix.jp/entry/2016/06/18/090000]] -[[ASP.NET Core備忘録(session and application state):http://blog.livedoor.jp/monthly_check/archives/71215916.html]] -[[ASP.NET Core MVCでSession管理:http://heinlein.hatenablog.com/entry/2017/11/21/141639]] -[[ASP.NET Core MVC: 認証機能を作る:https://blog.hmatoba.net/Article/130]] -[[ASP.NET Web APIを使用したセッションへのアクセス:https://code.i-harness.com/ja/q/926575]] -[[ASP.NET Coreでリアルタイムで接続するWebアプリケーション作ってみた:https://qiita.com/s_saito/items/39cfe82b0985a1bd10dc]] *基本 [#jde921dd] **設定 [#o33c7363] -NuGetで「Microsoft.AspNetCore.Session」パッケージを追加 -Startup.cs「ConfigureServices」に記述追加 services.AddDistributedMemoryCache(); services.AddSession(); -Startup.csの「Configure」に記述追加 app.UseSession(); **コード [#cf4903f2] HttpContext.Session.SetString("Test", "セッションテスト"); //値セット HttpContext.Session.GetString("Test"); //値取得