{"id":2644,"date":"2018-05-22T13:46:39","date_gmt":"2018-05-22T04:46:39","guid":{"rendered":"http:\/\/www.whoocus.com\/blog\/?p=2644"},"modified":"2018-05-22T13:46:39","modified_gmt":"2018-05-22T04:46:39","slug":"phoenix-%e3%81%a7session-%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.blowfish.co.jp\/?p=2644","title":{"rendered":"Phoenix \u3067session \u3092\u4f7f\u7528\u3059\u308b"},"content":{"rendered":"<p>\u25a0 PageController01 \u30bb\u30c3\u30b7\u30e7\u30f3\u8a2d\u5b9a<br \/>\n[ruby]<br \/>\n  def index(conn, _params) do<br \/>\n    conn = put_session(conn, :msg01, &quot;Hello session 01!!&quot;)<br \/>\n    conn = put_session(conn, :msg02, &quot;Hello session 02!!&quot;)<\/p>\n<p>    render conn, &quot;index.html&quot;<br \/>\n  end<br \/>\n[\/ruby]<\/p>\n<p>\u25a0 PageController02 \u30bb\u30c3\u30b7\u30e7\u30f3\u53d6\u5f97<br \/>\n[ruby]<br \/>\n  def index(conn, _params) do<br \/>\n    msg01 = get_session(conn, :msg01)<br \/>\n    msg02 = get_session(conn, :msg02)<br \/>\n    render(conn, &quot;index.html&quot;, [msg01: msg01, msg02: msg02])<br \/>\n  end<br \/>\n[\/ruby]<\/p>\n<p>\u25a0 index.html.eex \u30bb\u30c3\u30b7\u30e7\u30f3\u683c\u7d0d\u30c7\u30fc\u30bf\u8868\u793a<br \/>\n[ruby]<br \/>\n&lt;div&gt;MSG01: &lt;%= @msg01 %&gt;&lt;\/div&gt;<br \/>\n&lt;div&gt;MSG02: &lt;%= @msg02 %&gt;&lt;\/div&gt;<br \/>\n[\/ruby]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u25a0 PageController01 \u30bb\u30c3\u30b7\u30e7\u30f3\u8a2d\u5b9a [ruby] def index(conn, _params) do conn = put_session(conn, :msg01, &quot;Hello ses [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"saved_in_kubio":false,"footnotes":""},"categories":[53,54,4],"tags":[],"class_list":["post-2644","post","type-post","status-publish","format-standard","hentry","category-elixir","category-phoenix-framework","category-tech"],"_links":{"self":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2644"}],"version-history":[{"count":1,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2644\/revisions"}],"predecessor-version":[{"id":2645,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2644\/revisions\/2645"}],"wp:attachment":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}