{"image_url":null,"blog_url":"https://unageanu.hatenablog.com/","provider_name":"Hatena Blog","published":"2009-05-17 12:30:45","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Funageanu.hatenablog.com%2Fentry%2F20090517%2F1242531045\" title=\" \u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb - \u3046\u306a\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"\u3046\u306a\u306e\u65e5\u8a18","type":"rich","url":"https://unageanu.hatenablog.com/entry/20090517/1242531045","width":"100%","version":"1.0","author_url":"https://blog.hatena.ne.jp/unageanu/","title":" \u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb","categories":["Ruby","Sinatra"],"author_name":"unageanu","provider_url":"https://hatena.blog","description":"Sinatra\u3067Session\u3092\u4f7f\u3046\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002\u624b\u9806\u306f\u4ee5\u4e0b\u3002 \u300cset :sessions, true\u300d\u3067\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u6709\u52b9\u5316\u3002(\u3053\u306e\u3078\u3093\u306b\u8aac\u660e\u304c\u3042\u308a\u307e\u3059\u3002) \u5f8c\u306f\u3001\u300csession[]\u300d\u3067\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u5024\u306b\u30a2\u30af\u30bb\u30b9\u53ef\u80fd\u3067\u3059\u3002 \u3061\u306a\u307f\u306b\u3001session\u306fSinatra::Helpers\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u30e1\u30bd\u30c3\u30c9\u307f\u305f\u3044\u3002 require 'rubygems' require 'sinatra' # \u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u6709\u52b9\u5316 set :sessions, true get( \"/\" ) { # session\u30e1\u30bd\u30c3\u30c9\u3067\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3002 session[:value] = 0 un\u2026"}