Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7781767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:19:58+00:00 2026-06-01T19:19:58+00:00

I’m using the Facebook JavaScript SDK to implement login for my site. I’ve already

  • 0

I’m using the Facebook JavaScript SDK to implement login for my site. I’ve already got it working on Safari and Firefox, but not in Chrome.

After the FB.login method is called, I’m able to retrieve the access token from Facebook, but it’s not setting the access token and user ID in the cookies like it does in Firefox and Safari. Currently, I’m manually writing the access token and the user ID to the cookies so the login flow works but it still bugs the heck out of me that the access token is not written in Chrome alone.

Has anybody come across this before and know a fix at hand? Much appreciated.

Below are my code for the init and login logic:

window.fbAsyncInit = function() {
  FB.init({
    appId      : "#{AppConfig.facebook['app_id']}", // App ID
    status     : true, // check login status
    cookie     : true, // enable cookies to allow the server to access the session
    xfbml      : true  // parse XFBML
  });

  // Additional initialization code here
};

// Load the SDK Asynchronously
(function(d){
   var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
   if (d.getElementById(id)) {return;}
   js = d.createElement('script'); js.id = id; js.async = true;
   js.src = "//connect.facebook.net/en_US/all.js";
   ref.parentNode.insertBefore(js, ref);
 }(document));

$(function() {
  $(".fb-login-button").click(function() {
    FB.login(function(response) {
      if (response.authResponse) {
        console.log("Welcome! Fetching your information...");
        $.cookie("user_id", response.authResponse.userID);
        $.cookie("access_token", response.authResponse.accessToken);
        window.location = "#{oauth_facebook_callback_url}";
      } else {
        console.log("User cancelled login or did not fully authorize.");
      }
    }, {scope: 'publish_stream,offline_access,email,user_events,create_event,user_location'});
  });
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:20:00+00:00Added an answer on June 1, 2026 at 7:20 pm

    If you’re testing your application locally, note that Google Chrome does not support cookies for local files (including localhost) unless you start it with the --enable-file-cookies flag. Chrome does, however, support cookies if you use your local IP address—127.0.0.1— for testing.

    You can view a discussion on this behavior here: http://code.google.com/p/chromium/issues/detail?id=535

    (Answer modified from Why does Chrome ignore local jQuery cookies?)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.