PDA

View Full Version : Clean up sessions question...



JoacimEriksson
26-Nov-2007, 03:04 AM
Hi

When a user login to my webapp I get a session record and I create a
sessionkey folder where I store any pdf and other files that is created
during the session.
When I logout manualy I delete the folder and the files in it and delete the
session record as well as put a Logout record in my webblog table.

How to do it when I exit the browser or any action like that?

I had a thought of a timer in the webapp, but I read that it is probably not
the way to do it.
An other thought is to do the clen up process when the session is created.
In my case when the user enters the page, there is a few seconds before he
enters his name and password, that time I could do the clenup.
A third idea is to do it by a VDF, but that is the last way to do it as I
can see.

Any ideas/comments?

// joacim

Harm Wibier
26-Nov-2007, 05:13 AM
Hello Joacim,

I would do it using a scheduled VDF process that checks every minute / hour
/ day which sessions are timed out and deletes their tempolary files. But
the best sollution seems to depend on the context in which the files are
used.

--
Regards,


Harm Wibier
Data Access Europe B.V.
http://www.dataaccess.nl/


"Joacim Eriksson" <joacim@brl.nu> wrote in message
news:GDCJLMAMIHA.4932@dacmail.dataaccess.com...
> Hi
>
> When a user login to my webapp I get a session record and I create a
> sessionkey folder where I store any pdf and other files that is created
> during the session.
> When I logout manualy I delete the folder and the files in it and delete
> the session record as well as put a Logout record in my webblog table.
>
> How to do it when I exit the browser or any action like that?
>
> I had a thought of a timer in the webapp, but I read that it is probably
> not the way to do it.
> An other thought is to do the clen up process when the session is created.
> In my case when the user enters the page, there is a few seconds before he
> enters his name and password, that time I could do the clenup.
> A third idea is to do it by a VDF, but that is the last way to do it as I
> can see.
>
> Any ideas/comments?
>
> // joacim
>

JoacimEriksson
26-Nov-2007, 07:21 AM
Hi Harm

This was my thought, but there is a little problem in that you have to
execute the scheduler, ok there is always the Windows scheduler that can fix
this.
I have tried to use a modified dfTimer, that are build on cObject instead of
Textbox and that works nice ( as it looks like at the first glance )
I want it to run when the webapp is running.

// joacim


"Harm Wibier" <harm.wibier@dataaccess.nl> wrote in message
news:XCaEHUBMIHA.4932@dacmail.dataaccess.com...
> Hello Joacim,
>
> I would do it using a scheduled VDF process that checks every minute /
> hour / day which sessions are timed out and deletes their tempolary files.
> But the best sollution seems to depend on the context in which the files
> are used.
>
> --
> Regards,
>
>
> Harm Wibier
> Data Access Europe B.V.
> http://www.dataaccess.nl/
>
>
> "Joacim Eriksson" <joacim@brl.nu> wrote in message
> news:GDCJLMAMIHA.4932@dacmail.dataaccess.com...
>> Hi
>>
>> When a user login to my webapp I get a session record and I create a
>> sessionkey folder where I store any pdf and other files that is created
>> during the session.
>> When I logout manualy I delete the folder and the files in it and delete
>> the session record as well as put a Logout record in my webblog table.
>>
>> How to do it when I exit the browser or any action like that?
>>
>> I had a thought of a timer in the webapp, but I read that it is probably
>> not the way to do it.
>> An other thought is to do the clen up process when the session is
>> created. In my case when the user enters the page, there is a few seconds
>> before he enters his name and password, that time I could do the clenup.
>> A third idea is to do it by a VDF, but that is the last way to do it as I
>> can see.
>>
>> Any ideas/comments?
>>
>> // joacim
>>
>
>

Harm Wibier
26-Nov-2007, 07:38 AM
Hello Joacim,

We have several webapplications that have processes scheduled on the
background to do import, export, mailing and cleaning tasks. Doing these
jobs from the webapp itself mostly causes problems because the webapp is
designed to only handle calls from the client / ASP files and with the
single threaded nature of the VDF language you can't easilly start the task
asynchronously. Using a modified version of the dfTimer might do the job but
it sounds tricky to me.

--
Regards,


Harm Wibier
Data Access Europe B.V.
http://www.dataaccess.nl/


"Joacim Eriksson" <joacim@brl.nu> wrote in message
news:KWPoabCMIHA.4932@dacmail.dataaccess.com...
> Hi Harm
>
> This was my thought, but there is a little problem in that you have to
> execute the scheduler, ok there is always the Windows scheduler that can
> fix this.
> I have tried to use a modified dfTimer, that are build on cObject instead
> of Textbox and that works nice ( as it looks like at the first glance )
> I want it to run when the webapp is running.
>
> // joacim
>
>
> "Harm Wibier" <harm.wibier@dataaccess.nl> wrote in message
> news:XCaEHUBMIHA.4932@dacmail.dataaccess.com...
>> Hello Joacim,
>>
>> I would do it using a scheduled VDF process that checks every minute /
>> hour / day which sessions are timed out and deletes their tempolary
>> files. But the best sollution seems to depend on the context in which the
>> files are used.
>>
>> --
>> Regards,
>>
>>
>> Harm Wibier
>> Data Access Europe B.V.
>> http://www.dataaccess.nl/
>>
>>
>> "Joacim Eriksson" <joacim@brl.nu> wrote in message
>> news:GDCJLMAMIHA.4932@dacmail.dataaccess.com...
>>> Hi
>>>
>>> When a user login to my webapp I get a session record and I create a
>>> sessionkey folder where I store any pdf and other files that is created
>>> during the session.
>>> When I logout manualy I delete the folder and the files in it and delete
>>> the session record as well as put a Logout record in my webblog table.
>>>
>>> How to do it when I exit the browser or any action like that?
>>>
>>> I had a thought of a timer in the webapp, but I read that it is probably
>>> not the way to do it.
>>> An other thought is to do the clen up process when the session is
>>> created. In my case when the user enters the page, there is a few
>>> seconds before he enters his name and password, that time I could do the
>>> clenup.
>>> A third idea is to do it by a VDF, but that is the last way to do it as
>>> I can see.
>>>
>>> Any ideas/comments?
>>>
>>> // joacim
>>>
>>
>>
>
>

DavidMartinko
26-Nov-2007, 08:46 AM
I subclassed my cCrystal to be a cCrystalWeb. This class creates a unique
folder for each report that is output. When the report has been exported, I
launch a VDF application which sleeps for X minutes and then completes its
job and exits. Its sole job is to delete the export and the folder.

So a request comes in for a report, I create a unique folder (32 random
characters). Then the report is run and exported to this new folder. Next, a
Cleanup.Exe is launched. The client has 5 minutes to get their report and
then Cleanup.Exe wakes up and removes the report and the folder. Cleanup.Exe
takes 2 command line parameters: 1) the folder 2) the sleep time.



--
David Martinko
Custom Software Developer
Redeemed Software Company
www.RedeemedSoftware.com
248-535-7495
"Joacim Eriksson" <joacim@brl.nu> wrote in message
news:GDCJLMAMIHA.4932@dacmail.dataaccess.com...
> Hi
>
> When a user login to my webapp I get a session record and I create a
> sessionkey folder where I store any pdf and other files that is created
> during the session.
> When I logout manualy I delete the folder and the files in it and delete
> the session record as well as put a Logout record in my webblog table.
>
> How to do it when I exit the browser or any action like that?
>
> I had a thought of a timer in the webapp, but I read that it is probably
> not the way to do it.
> An other thought is to do the clen up process when the session is created.
> In my case when the user enters the page, there is a few seconds before he
> enters his name and password, that time I could do the clenup.
> A third idea is to do it by a VDF, but that is the last way to do it as I
> can see.
>
> Any ideas/comments?
>
> // joacim
>

Evertjan Dondergoor
26-Nov-2007, 10:21 AM
Webapp is designed to wait for client requests, not to handle timers. What
if a client request comes in while your webapp is handling a timer?

Using timers in webapp is dirty and tricky.
Using windows scheduler is a clean and simple solution. :-)

Evertjan

"Joacim Eriksson" <joacim@brl.nu> wrote in message
news:KWPoabCMIHA.4932@dacmail.dataaccess.com...
> Hi Harm
>
> This was my thought, but there is a little problem in that you have to
> execute the scheduler, ok there is always the Windows scheduler that can
> fix this.
> I have tried to use a modified dfTimer, that are build on cObject instead
> of Textbox and that works nice ( as it looks like at the first glance )
> I want it to run when the webapp is running.
>
> // joacim
>
>
> "Harm Wibier" <harm.wibier@dataaccess.nl> wrote in message
> news:XCaEHUBMIHA.4932@dacmail.dataaccess.com...
>> Hello Joacim,
>>
>> I would do it using a scheduled VDF process that checks every minute /
>> hour / day which sessions are timed out and deletes their tempolary
>> files. But the best sollution seems to depend on the context in which the
>> files are used.
>>
>> --
>> Regards,
>>
>>
>> Harm Wibier
>> Data Access Europe B.V.
>> http://www.dataaccess.nl/
>>
>>
>> "Joacim Eriksson" <joacim@brl.nu> wrote in message
>> news:GDCJLMAMIHA.4932@dacmail.dataaccess.com...
>>> Hi
>>>
>>> When a user login to my webapp I get a session record and I create a
>>> sessionkey folder where I store any pdf and other files that is created
>>> during the session.
>>> When I logout manualy I delete the folder and the files in it and delete
>>> the session record as well as put a Logout record in my webblog table.
>>>
>>> How to do it when I exit the browser or any action like that?
>>>
>>> I had a thought of a timer in the webapp, but I read that it is probably
>>> not the way to do it.
>>> An other thought is to do the clen up process when the session is
>>> created. In my case when the user enters the page, there is a few
>>> seconds before he enters his name and password, that time I could do the
>>> clenup.
>>> A third idea is to do it by a VDF, but that is the last way to do it as
>>> I can see.
>>>
>>> Any ideas/comments?
>>>
>>> // joacim
>>>
>>
>>
>
>

JoacimEriksson
27-Nov-2007, 02:23 AM
Hi

I figured that out of the info I got so I will not do it with the timer,
however, the timer works nice built on cObject :-)
I will go the schedule on VDF way.

have a nice day

// joacim

"Evertjan Dondergoor" <evertjan.dondergoor@dataaccess.nl> wrote in message
news:9AEiRAEMIHA.2640@dacmail.dataaccess.com...
> Webapp is designed to wait for client requests, not to handle timers. What
> if a client request comes in while your webapp is handling a timer?
>
> Using timers in webapp is dirty and tricky.
> Using windows scheduler is a clean and simple solution. :-)
>
> Evertjan
>
> "Joacim Eriksson" <joacim@brl.nu> wrote in message
> news:KWPoabCMIHA.4932@dacmail.dataaccess.com...
>> Hi Harm
>>
>> This was my thought, but there is a little problem in that you have to
>> execute the scheduler, ok there is always the Windows scheduler that can
>> fix this.
>> I have tried to use a modified dfTimer, that are build on cObject instead
>> of Textbox and that works nice ( as it looks like at the first glance )
>> I want it to run when the webapp is running.
>>
>> // joacim
>>
>>
>> "Harm Wibier" <harm.wibier@dataaccess.nl> wrote in message
>> news:XCaEHUBMIHA.4932@dacmail.dataaccess.com...
>>> Hello Joacim,
>>>
>>> I would do it using a scheduled VDF process that checks every minute /
>>> hour / day which sessions are timed out and deletes their tempolary
>>> files. But the best sollution seems to depend on the context in which
>>> the files are used.
>>>
>>> --
>>> Regards,
>>>
>>>
>>> Harm Wibier
>>> Data Access Europe B.V.
>>> http://www.dataaccess.nl/
>>>
>>>
>>> "Joacim Eriksson" <joacim@brl.nu> wrote in message
>>> news:GDCJLMAMIHA.4932@dacmail.dataaccess.com...
>>>> Hi
>>>>
>>>> When a user login to my webapp I get a session record and I create a
>>>> sessionkey folder where I store any pdf and other files that is created
>>>> during the session.
>>>> When I logout manualy I delete the folder and the files in it and
>>>> delete the session record as well as put a Logout record in my webblog
>>>> table.
>>>>
>>>> How to do it when I exit the browser or any action like that?
>>>>
>>>> I had a thought of a timer in the webapp, but I read that it is
>>>> probably not the way to do it.
>>>> An other thought is to do the clen up process when the session is
>>>> created. In my case when the user enters the page, there is a few
>>>> seconds before he enters his name and password, that time I could do
>>>> the clenup.
>>>> A third idea is to do it by a VDF, but that is the last way to do it as
>>>> I can see.
>>>>
>>>> Any ideas/comments?
>>>>
>>>> // joacim
>>>>
>>>
>>>
>>
>>
>
>