Method: FGraph::Rails::FGraphHelper#fgraph_session_cookies
- Defined in:
- lib/fgraph/rails/fgraph_helper.rb
#fgraph_session_cookies(app_id = fgraph_config['app_id'], app_secret = fgraph_config['app_secret']) ⇒ Object
Return Facebook session cookies.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/fgraph/rails/fgraph_helper.rb', line 19 def (app_id = fgraph_config['app_id'], app_secret = fgraph_config['app_secret']) return @fgraph_session_cookies if @fgraph_session_cookies return if @fgraph_session_cookies == false = request.["fbsr_#{app_id}"] if app_id.blank? or app_secret.blank? or .blank? return @fgraph_session_cookies = false end # Get authorization code and access token signed_request = fgraph_parse_signed_request(, app_secret) resp = FGraph.oauth_access_token(app_id, app_secret, :code => signed_request['code']) @fgraph_session_cookies = { 'access_token' => resp['access_token'] } end |