[fpc-pascal] web app and application persistency

Gustavo Enrique Jimenez gejimenez at gmail.com
Mon Aug 1 17:24:12 CEST 2011


Hi:

  If you don't want to use cookies, you could write the sessionID in a
hidden field in every html form (cgi app must write this hidden field
in every form). Or, if you use ajax, you could attach the sessionID to
every link (cgi app must write the sessionID parameter in every link).

Gustavo


2011/8/1 Gustavo Enrique Jimenez <gejimenez at gmail.com>:
> Hi:
>
>  I send cookies to the client. One of those cookies is a "sessionID",
> a random number generated at login.
>  My sequence is something like
>
> Login
> Client: username/password ->Login html button
> Server: run cgi app with username/password parameters -> ¿Valid user?
> ->  generate sessionID, store in DB. Send sessionID to the client as a
> cookie.
>
> Transaction
> Client: Product -> Search product html button (sessionID is also sent
> to the server)
> Server: run cgi app with product/username parameter. sessionID is
> implicit, as any cookie. if username/sessionID from the client is the
> same as in the DB, send data to the client.
>
> The sessionID cookie will remain until logout or expire time. This
> way, you don't have to store password in html. The sessionID cookie
> must be random+hash, unique to every session. sessionID is sort of
> temporal password.
>
> Cliente: username  -> Logout html button
> Server: run cgi app with username/sessionID. Verify
> username/sessionID, then send an empty sessionID cookie (this will
> delete the sessionID cookie in client)
>
> Gustavo
>
>
>
>>2011/8/1 Felipe Monteiro de Carvalho <felipemonteiro.carvalho at gmail.com>:
>> Hello,
>>
>> This is kind of a theorical question, but I though I'd ask before
>> starting to code =)
>>
>> Basically I have a desktop app which I need to retrofit into a
>> web-app. My idea is to cut it in a visual and a non-visual part and
>> implement the visual part in HTML+JavaScript and keep the non-visual
>> like it is now, in Pascal.
>>
>> So, the problem is that CGI apps are started for every request, correct?
>>
>> So how should I proceed to obtain a application which will keep
>> running for the entire session of a user? I don't want to simply save
>> session info because the application is rather large, there are lots
>> of things going on and it would be much easier for my coding if I
>> could keep the program running on the web server ...
>>
>> Any ideas?
>>
>> thanks,
>> --
>> Felipe Monteiro de Carvalho
>> _______________________________________________
>> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>
>



More information about the fpc-pascal mailing list