{"action":"created","issue":{"url":"https://api.github.com/repos/makersacademy/slack-overflow/issues/102","labels_url":"https://api.github.com/repos/makersacademy/slack-overflow/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/makersacademy/slack-overflow/issues/102/comments","events_url":"https://api.github.com/repos/makersacademy/slack-overflow/issues/102/events","html_url":"https://github.com/makersacademy/slack-overflow/issues/102","id":106770569,"number":102,"title":"Sinatra session not saving after redirect","user":{"login":"chweeks","id":13521236,"avatar_url":"https://avatars.githubusercontent.com/u/13521236?v=3","gravatar_id":"","url":"https://api.github.com/users/chweeks","html_url":"https://github.com/chweeks","followers_url":"https://api.github.com/users/chweeks/followers","following_url":"https://api.github.com/users/chweeks/following{/other_user}","gists_url":"https://api.github.com/users/chweeks/gists{/gist_id}","starred_url":"https://api.github.com/users/chweeks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chweeks/subscriptions","organizations_url":"https://api.github.com/users/chweeks/orgs","repos_url":"https://api.github.com/users/chweeks/repos","events_url":"https://api.github.com/users/chweeks/events{/privacy}","received_events_url":"https://api.github.com/users/chweeks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-16T13:11:49Z","updated_at":"2015-09-16T15:08:25Z","closed_at":null,"body":"We are trying to save :name to sessions on the '/name_input' page, where it then redirects to the '\\game_setup' where the sessions[:name] can be accessed.\r\n```\r\n  enable :sessions\r\n\r\n  get '/name_input' do\r\n    erb :name_input\r\n  end\r\n\r\n  post '/name_input' do\r\n    session[:name] = params[:name]\r\n    p session[:name]\r\n    redirect ('/game_setup')\r\n  end\r\n\r\n  get '/game_setup' do\r\n    p session[:name]\r\n    erb :game_setup\r\n  end\r\n```\r\nname_input.erb \r\n\r\n```\r\n<% if @name && !@name.empty? %>\r\n  <%= @name %>'s Game\r\n<% else %>\r\n  <form action=\"/name_input\" method=\"post\">\r\n    What's your name?\r\n    <input type=\"text\" name=\"name\" required autofocus>\r\n    <input type=\"submit\" value=\"New Game\">\r\n  </form>\r\n<% end %>\r\n```\r\n<img width=\"616\" alt=\"screen shot 2015-09-16 at 13 53 44\" src=\"https://cloud.githubusercontent.com/assets/13521236/9905278/0059b086-5c7c-11e5-8041-fcc856671a01.png\">\r\n\r\nThe screenshot above shows in terminal that the session[:name] is \"Chris\" before the redirect ('/game_setup') but is nil within the '/game_setup'."},"comment":{"url":"https://api.github.com/repos/makersacademy/slack-overflow/issues/comments/140770812","html_url":"https://github.com/makersacademy/slack-overflow/issues/102#issuecomment-140770812","issue_url":"https://api.github.com/repos/makersacademy/slack-overflow/issues/102","id":140770812,"user":{"login":"chweeks","id":13521236,"avatar_url":"https://avatars.githubusercontent.com/u/13521236?v=3","gravatar_id":"","url":"https://api.github.com/users/chweeks","html_url":"https://github.com/chweeks","followers_url":"https://api.github.com/users/chweeks/followers","following_url":"https://api.github.com/users/chweeks/following{/other_user}","gists_url":"https://api.github.com/users/chweeks/gists{/gist_id}","starred_url":"https://api.github.com/users/chweeks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chweeks/subscriptions","organizations_url":"https://api.github.com/users/chweeks/orgs","repos_url":"https://api.github.com/users/chweeks/repos","events_url":"https://api.github.com/users/chweeks/events{/privacy}","received_events_url":"https://api.github.com/users/chweeks/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T15:08:25Z","updated_at":"2015-09-16T15:08:25Z","body":"https://github.com/chweeks/BattleshipsWeb"}}