How Can I Create Session Objects?

Results 1 to 4 of 4

Thread: How Can I Create Session Objects?

  1. #1
    Milton Alexandre [BR] Guest

    Default How Can I Create Session Objects?

    Hi, all<BR><BR>I am trying to create a session object within my "Default.asp" page, as following:<BR><BR>Set Session("MyObj") = Server.CreateObject("MyLib.MyClass")<BR><BR>It seems like possible. But I can not do:<BR><BR>Session("MyObj").MyMethod<BR><BR>or<BR> <BR>Session("MyObj").MyProp = "MyString"<BR><BR>Is there anything wrong?<BR><BR>Thanks for any help<BR><BR> Alexandre

  2. #2
    mark Guest

    Default RE: How Can I Create Session Objects?

    I think that you may have to create a temporary variable to get the session object contents. I *think* that a session variable is only a pointer to the information. I may be wrong.<BR><BR>Like:<BR>temp = Session("myObj")<BR>temp.MyMethod<BR><BR>I&#039;m not certain, but you may have to set temp = Server.CreateObject("MyLib.MyClass) as well.

  3. #3
    RDM Guest

    Default The bigger question...

    What type of object is this? What&#039;s the class written in?<BR>You&#039;ll want to be very careful storing objects in session variables for performance reasons. The practice contradicts the Windows DNA methodology of using then destroying objects as soon as possible. Please provide more details as to why you want the object in a session variable...

  4. #4
    Join Date
    Dec 1969

    Default RE: How Can I Create Session Objects?

    1. you can&#039;t define a session method. Well. you may be able to in JScript, but 99.9% no way.<BR><BR>2. Session("variableName") = "variablevalue"<BR><BR>works for everyone else, why not use that?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts