ASP server attempt. Is it possible to implement, Session("name")="Damian"; Application("name")="test"

I'm looking at modifing our www server embedded in our product with some ASP similar features.  Will have 1 JS runtime, and a pool of JS contexts

First I thought 'Session' could be a property of the global object, but then you can't pass a arguement to a property.  I was planning keeping the data in C++, when the user requested it, convert/copy it to a jsval.

Now I'm thinking Session is more like a global JS array.  But then its entire contents will be stored against the global object.  Which is ok, I don't need to know the infor from C++.  Which means I would need to keep 1 global object per user session.  Except the script keeps changing depending on whats in each ASP page, so the global object needs to "reset" any script local variables, which means I loose the Session variable.  Or can I lock it?

That sort of works ok for user session variables, cause that is not shared between users.  But what about an Application object which needs to be accessible by all scripts?

Can I effectively create a Application object in the Runtime, and define a reference to it in each global object?


Anyone have any better solutions or experiences?

Thanks,

Damian



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004
 

0
Damian
9/7/2004 4:48:40 AM
netscape.mozilla.jseng 1530 articles. 0 followers. Follow

1 Replies
655 Views

Similar Articles

[PageSpeed] 16

Damian Slee wrote:

> First I thought 'Session' could be a property of the global object,
> but then you can't pass a arguement to a property.


See JS_SetCallReturnValue2 in jsapi.h, and its example usage in js.c.


> Can I effectively create a Application object in the Runtime, and
> define a reference to it in each global object?


Sure, you can do that.

/be
0
Brendan
9/7/2004 5:44:22 AM
Reply:

Web resources about - ASP server attempt. Is it possible to implement, Session("name")="Damian"; Application("name")="test" - netscape.mozilla.jseng

Resources last updated: 1/21/2016 10:49:44 AM