Hi all,
I'm trying to store a class object in a session (I actually use ExpressJS). For class properties everything is fine, but class methods are missed, when I access the object.
So for example, I have a class:
var SomeClass = module.exports = function() {
this.param1 = "1";
this.param2 = "2";
this.param3 = function(){ return "3"; };
}
And I instantiate it directly to a session:
req.session.myobj = new SomeClass();
When the new request is made, I'm trying to access the object req.session.myobj, and I can access only param1 and param2; param3 is unreachable (it is not defined).
Is there any way to solve it?
Thanks.