NetTalk Central

Author Topic: Session without need of a session  (Read 2366 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Session without need of a session
« on: May 13, 2013, 04:09:08 PM »
Hi,
I have a NTWS in which some users log in and use it.
The same server serves a page that can be requested by anybody withot the need of a log in.
Problem is that at the end of the day there are hundreds of sessions to delete and this session are not from users, I think these sessions are from the free page request.
The proc that serves that request is a NetWebSource proc and it has a very simple code to construct the html and send the paket like the following code:
It just uses the p_web.Getvalue()
How can I avoid to use hundreds of sessions or how can I delete the session every time I serve the page?
Thanks

    Access:Cotiza.Open()
    Access:Cotiza.UseFile()
    Funcion" = p_web.GetValue('F')  !funcion F=A solo un tiker para Android

    if Funcion"='A'   
        Cot:Especie = p_web.GetValue('T')
        Cot:Moneda  = p_web.GetValue('M')
        if not Access:Cotiza.Fetch(Cot:xEspecieMoneda)
       
        packet = '<esp>'&clip(Cot:Especie)&'</esp>'& |
                '<mon>'&clip(Cot:Moneda)&'</mon>'& |
                '<ult>'&clip(left(Cot:Ultimo))&'</ult>'& |
                '<dia>'&clip(left(Cot:Dia))&'</dia>'& |
                '<ape>'&clip(left(Cot:Apertura))&'</ape>'& |
                '<max>'&clip(Cot:Maximo)&'</max>'& |
                '<min>'&clip(Cot:Minimo)&'</min>'& |
                '<cie>'&clip(left(Cot:Anterior))&'</cie>'& |
                '<vol>'&clip(cot:Volumen)&'</vol>'& |
                '<fec>'&format(Cot:FechaUltimo,@d6)&'</fec>'& |
                '<hr>'&clip(Cot:Hora)&'</hr>'
        ELSE
            packet = 'Error'
        END
    elsif Funcion"='S'     !todos de un determinado sector
        clear(Cot:Record)
        Sector" = p_web.GetValue('S')
        Hoy#    = p_web.GetValue('H')
        if  Sector"='L' then Sector"='LĂ­der'.
        if  Sector"='G' then Sector"='General'.
        if  Sector"='B' then Sector"='Bonos'.
        if  Sector"='O' then Sector"='Opciones'.
        Cot:Sector = Sector"
        set(Cot:xSectorEspecie,Cot:xSectorEspecie)
        LOOP
            next(Cotiza)
            !message(error()&' '&Cot:sector&' '&Cot:Especie)
            if error() or Cot:Sector <> Sector" then  break.
            if Hoy#=1 and Cot:FechaUltimo<>today() then cycle.
            if Cot:FechaUltimo<deformat('01/01/2013',@d06) then cycle.
            Mipacket = clip(Mipacket) &|
                clip(Cot:Especie)&'<13,10>'& |
                clip(Cot:Moneda)&'<13,10>'& |
                clip(left(Cot:Ultimo))&'<13,10>'& |
                clip(left(Cot:Dia))&'<13,10>'& |
                clip(left(Cot:CantBid))&'<13,10>'& |
                clip(left(Cot:Bid))&'<13,10>'& |
                clip(left(Cot:Ask))&'<13,10>'& |
                clip(left(Cot:CantAsk))&'<13,10>'& |
                clip(left(Cot:Apertura))&'<13,10>'& |
                clip(Cot:Maximo)&'<13,10>'& |
                clip(Cot:Minimo)&'<13,10>'& |
                clip(left(Cot:Anterior))&'<13,10>'& |
                clip(cot:Volumen)&'<13,10>'& |
                format(Cot:FechaUltimo,@d6)&'<13,10>'& |
                clip(Cot:Hora)&'<13,10>'
        END
        Mipacket = clip(Mipacket) & '<13,10>'
    END

    do SendPacket
       
-----------
Regards
Alberto

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Session without need of a session
« Reply #1 on: May 13, 2013, 04:49:20 PM »
try p_web.DeleteSession or reduce the sessiontimeout setting on the template so they are auto deleted quicker although this will also affect logged on users and force them to log back on.