On Tue, Jan 10, 2012 at 5:28 AM, Dor Tzur <dort...@gmail.com> wrote: > I would like to access a user the same way i access a group. > would it be wise to create a new group with unique identifier for each > user?
I'm aware of the clientId identifier and the nowjs.getClient
However, i'm using a RESTful service to push data from a remote server
to our users through now.js. The server only knows about an external-
ID.
The way i see it i have two options:
A. keep a pairing of an external-ID to a client-ID on the remote
server or the now.js server, refreshing the client-ID on each page
change (the external-ID is consistent throughout the session), and
then using the nowjs.getClient method as you suggested.
B. Creating a group with that user's external-ID and adding him to
that group on each page change, essentially creating the pairing that
way, as i implied originally.
I hope i was clear enough with my explanation, I would sincerely like
to hear your thoughts on the subject matter.
Thanks for the quick response.
On Jan 10, 6:03 pm, Eric Zhang <e...@nowjs.com> wrote:
> On Tue, Jan 10, 2012 at 5:28 AM, Dor Tzur <dort...@gmail.com> wrote:
> > I would like to access a user the same way i access a group.
> > would it be wise to create a new group with unique identifier for each
> > user?
Are you talking about just keeping track of a user across page refreshes, like you normally do with a session? You have access to session cookies in nowjs but you can also take a look at a couple nowjs extensions I'm working on, and contribute if you want!
https://github.com/ianserlin/now-middleware - let's you hook into the remote function call sequence and inject callbacks that do things (like process data) before the server-side function the client was actually trying to call is executed https://github.com/ianserlin/now-sessions - uses now-middleware to make standard http session information to server-side now callbacks via this.now.session inside your function
On Tue, Jan 10, 2012 at 12:48 PM, Dor Tzur <dort...@gmail.com> wrote: > I'm aware of the clientId identifier and the nowjs.getClient > However, i'm using a RESTful service to push data from a remote server > to our users through now.js. The server only knows about an external- > ID. > The way i see it i have two options:
> A. keep a pairing of an external-ID to a client-ID on the remote > server or the now.js server, refreshing the client-ID on each page > change (the external-ID is consistent throughout the session), and > then using the nowjs.getClient method as you suggested.
> B. Creating a group with that user's external-ID and adding him to > that group on each page change, essentially creating the pairing that > way, as i implied originally.
> I hope i was clear enough with my explanation, I would sincerely like > to hear your thoughts on the subject matter. > Thanks for the quick response.
> On Jan 10, 6:03 pm, Eric Zhang <e...@nowjs.com> wrote: > > Hey Dor,
> > On Tue, Jan 10, 2012 at 5:28 AM, Dor Tzur <dort...@gmail.com> wrote: > > > I would like to access a user the same way i access a group. > > > would it be wise to create a new group with unique identifier for each > > > user?
> Are you talking about just keeping track of a user across page refreshes,
> like you normally do with a session? You have access to session cookies in
> nowjs but you can also take a look at a couple nowjs extensions I'm working
> on, and contribute if you want!
> https://github.com/ianserlin/now-middleware- let's you hook into the
> remote function call sequence and inject callbacks that do things (like
> process data) before the server-side function the client was actually
> trying to call is executedhttps://github.com/ianserlin/now-sessions- uses now-middleware to make
> standard http session information to server-side now callbacks via
> this.now.session inside your function
> On Tue, Jan 10, 2012 at 12:48 PM, Dor Tzur <dort...@gmail.com> wrote:
> > I'm aware of the clientId identifier and the nowjs.getClient
> > However, i'm using a RESTful service to push data from a remote server
> > to our users through now.js. The server only knows about an external-
> > ID.
> > The way i see it i have two options:
> > A. keep a pairing of an external-ID to a client-ID on the remote
> > server or the now.js server, refreshing the client-ID on each page
> > change (the external-ID is consistent throughout the session), and
> > then using the nowjs.getClient method as you suggested.
> > B. Creating a group with that user's external-ID and adding him to
> > that group on each page change, essentially creating the pairing that
> > way, as i implied originally.
> > I hope i was clear enough with my explanation, I would sincerely like
> > to hear your thoughts on the subject matter.
> > Thanks for the quick response.
> > On Jan 10, 6:03 pm, Eric Zhang <e...@nowjs.com> wrote:
> > > Hey Dor,
> > > On Tue, Jan 10, 2012 at 5:28 AM, Dor Tzur <dort...@gmail.com> wrote:
> > > > I would like to access a user the same way i access a group.
> > > > would it be wise to create a new group with unique identifier for each
> > > > user?
I wouldn't say it's production ready because it has no tests. Don't have time to look into doing that today though but I am using these in a project I'm working on so I don't have to look up the current user's session information every time I make a call to a server-side function either through a getClient hash or by having the client pass it's user.id.
On Wed, Jan 11, 2012 at 12:33 AM, Dor Tzur <dort...@gmail.com> wrote: > yeah that should fit the bill. > Is it production ready in your opinion?
> On Jan 11, 1:57 am, Ian Serlin <i...@ianserlin.com> wrote: > > Are you talking about just keeping track of a user across page refreshes, > > like you normally do with a session? You have access to session cookies > in > > nowjs but you can also take a look at a couple nowjs extensions I'm > working > > on, and contribute if you want!
> > https://github.com/ianserlin/now-middleware- let's you hook into the > > remote function call sequence and inject callbacks that do things (like > > process data) before the server-side function the client was actually > > trying to call is executedhttps://github.com/ianserlin/now-sessions-uses now-middleware to make > > standard http session information to server-side now callbacks via > > this.now.session inside your function
> > On Tue, Jan 10, 2012 at 12:48 PM, Dor Tzur <dort...@gmail.com> wrote: > > > I'm aware of the clientId identifier and the nowjs.getClient > > > However, i'm using a RESTful service to push data from a remote server > > > to our users through now.js. The server only knows about an external- > > > ID. > > > The way i see it i have two options:
> > > A. keep a pairing of an external-ID to a client-ID on the remote > > > server or the now.js server, refreshing the client-ID on each page > > > change (the external-ID is consistent throughout the session), and > > > then using the nowjs.getClient method as you suggested.
> > > B. Creating a group with that user's external-ID and adding him to > > > that group on each page change, essentially creating the pairing that > > > way, as i implied originally.
> > > I hope i was clear enough with my explanation, I would sincerely like > > > to hear your thoughts on the subject matter. > > > Thanks for the quick response.
> > > On Jan 10, 6:03 pm, Eric Zhang <e...@nowjs.com> wrote: > > > > Hey Dor,
> > > > On Tue, Jan 10, 2012 at 5:28 AM, Dor Tzur <dort...@gmail.com> wrote: > > > > > I would like to access a user the same way i access a group. > > > > > would it be wise to create a new group with unique identifier for > each > > > > > user?