NetTalk Central

Author Topic: how to detech session timeout  (Read 4922 times)

cwtart

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • CommPay Software
    • Email
how to detech session timeout
« on: January 18, 2008, 10:20:43 AM »
Hello,

In NetTalk web server I want to detect a session timeout so I can update a user-logged-in history table. What embed is available in the web server procedure to do this and how would I identify what session/user was timed-out? Thanks.

Chuck

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: how to detech session timeout
« Reply #1 on: January 22, 2008, 02:49:15 AM »
Hi Chuck,

In the WebServer procedure (not WebHandler)there is a method called
_DeleteSession. This takes a parameter called p_SessionID.
This is called when a session is deleted, so add your code here, just before the parent call.

Cheers
Bruce


cwtart

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • CommPay Software
    • Email
Re: how to detech session timeout
« Reply #2 on: January 27, 2008, 10:04:18 AM »
Bruce,

Okay - next question. How do I retrieve these values

!    LGH:USERNAME  = p_web.GetSessionValue('UserLogged')
!    LGH:STORENAME = p_web.GetSessionValue('LoggedStoreName')

in the embed?

If I leave the code as above I get a compiler error. I assume I need to use the session ID to get the session queue record for each item I need. Don't know how to do this. Please explain.

Chuck Tart

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: how to detech session timeout
« Reply #3 on: January 27, 2008, 10:51:05 PM »
You're in the web server object (in the webServer procedure, in the _DeleteSession method, so you don't use p_web, you use SELF.

The SessionID is passed as the parameter p_SessionID

The NetWebServer has a method, _GetSessionValue(SessionId, Name, Error).

So create a long (e) to get the error number;

E  LONG

Then you can call the method like this;

whatever = Self._GetSessionValue(p_SessionID,'something',e)

Cheers
Bruce

cwtart

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • CommPay Software
    • Email
Re: how to detech session timeout
« Reply #4 on: January 28, 2008, 06:37:00 AM »
Bruce,

Thanks - I had already figured this out myself by looking in NetTalk.clw

I used this code;

LGH:userhame = ThisWebServer._GetSessionValuep_SessionID, 'UserLogged' ,SessionError)
LGH:storename =Th isWebServer._GetSessionValuep_SessionID, 'StoreName' ,SessionError)

Thanks again,

Chuck Tart