Jump to content

Recommended Posts

Posted

I'm developing a Third Party Login System (Oauth) like facebook developers and I need to set cookies multiple domains (depends on how many domains user specifies). So I need to set cookies to all the domains a user specifies using jquery, I've tried everything but none has worked. All I found is "create an iframe","use ajax to set a cookie across multiple domains" but they will not work in my case because, it will need the user to create a html for the iframe or a php file for ajax request that I don't want to do. What I want to do is let the user include the Jquery SDK and allow the user to make requests and to make requests SDK will set cookies so I need to use a cookie for all the specified domains.

Here is the flow of how it works:

It've two initialization methods "NM.init()" & "NM.login.init()"

First of all, user calls NM.init() to set his/her App ID & App Secret. (Here the SDK uses cookies to set the App ID and Secret for every domain configured in the app)

Then, user calls NM.login.init() to set the fields he/she wants to retrieve. (Here the SDK uses cookies to set the Fields for every domain configured in the app)

After that, user calls NM.login.request() to retrieve the fields he/he set in NM.login.init(). (He can call NM.login.request() either from the same page/domain where he/she called NM.init() and NM.login.init() or from any other page/domain).

In case if user calls NM.login.request from another domain, it needed to get the cookies set on other domain.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...