Thanks for the clarification *Aria*. Coming from PHP background I overlooked these issues. My bad.
I was not able to open .p7s file. I tried it to open in my ms outlook, but failed. Can you please upload it in .txt format, maybe zipped ? *Thanks ..* On Sunday, March 1, 2015 at 4:08:29 AM UTC+5:30, Aria Stewart wrote: > > > > On 28 Feb 2015, at 06:31, Satish B <[email protected] <javascript:>> > wrote: > > > > After working with Node.js for some months, I was shocked to know > recently that the global variables are actually shared between the users! > > > > Example: If 1 user sets the value of a global variable to 10, the value > will be 10 to other user too. > > > > In other programming languages like PHP, separate instances of these > variables are created, unlike in Node.js > > > > > > I want to know if variables inside the route are also shared between the > users? I guess the req object makes it a separate instance for each user. > > I've not got a proper way to test this, so asking the community. > > > They are not, generally, if you mean a 'route' as in this: > > app.get('/path', function (req, res) { > var thisvariablerighthere = 1; > }); > > Javascript is lexically scoped, so each time a function is run, variables > declared within it (look for the var keyword!) are given a new allocation. > > Functions within that scope can see 'outward' to those variables, but > things outside can't see 'in' and see the varying variables within a > function. > > The thing that surprises you coming from PHP is that unlike PHP, node _is_ > the web server, so its toplevel variables actually last the duration of the > server's run, not any individual request. PHP, on the other hand, its top > level is matched lifetime-wise to a request. > > Aria -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/5b6fd88a-607f-4409-ba88-2fee1a4f11e8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
