Re: Tcl and sessions (for web apps)

From: Andrew Piskorski (atp_at_piskorski.com)
Date: 12/16/03


Date: 16 Dec 2003 12:05:35 -0800

Jochem Huhmann <joh@gmx.net> wrote in message news:<87d6avtogf.fsf@nova.revier.com>...

> Yes, I know (and happen to like) tclhttpd but in this case I can't use
> it, because I can't run my own server app. To be precise I have to cope
> with what I can do with Apache and CGI and an ordinary user account
> (yeah, I could run tclhttpd on an unprivileged port technically, but I
> can't by policy).
>
> Mind you, I _have_ PHP (as module) with all bells and
> whistles available there, but since this task is quite performance
> agnostic I can afford to do it by means of CGI and this gives me the

The OpenACS toolkit has extensive Tcl code for securely generating and
tracking session keys and cookies which you could probably rip out and
re-use. Likely plenty of AOLserver API dependencies there, but John
Sequeira and Michael Cleverly have worked on getting a lot of the
OpenACS Tcl code to work from tclsh without AOLserver, so it's
probably feasible.

Where are you keeping your session state? If you can load the OraTcl
or Pgtcl (or possible sqllite) Tcl modules into your tclsh, you should
probably consider keeping it in an RDBMS. Initializing a brand new
database connection on every CGI hit is ugly, but since you're certain
the CGI performance hit isn't a problem for you, the db connection hit
probably wouldn't be either.

Is this a hosted application? If so you're probably better off
switching to a hosting provider that will let you run the tools you
want and need, rather than crippling your choice of tools. They take
more work to locate but you should be able to find low cost hosting
providers that will let you run pretty much anything and everything
you want.

<http://openacs.org/>
<http://oratcl.sourceforge.net/>
<http://www.us.postgresql.org/postgresql-7.3.3/pgtcl.html>
<http://www.hwaci.com/sw/sqlite/>



Relevant Pages

  • Re: VB and professional application
    ... hit send before I was done. ... I've written numerous cgi executables in straight VB6 with very few API ... I did those apps in a fraction of the time that I could ...
    (microsoft.public.vb.general.discussion)
  • CGI problem fith file URIs
    ... I am developing a help viewer app with CGI pm. ... However I have hit a ... roadblocjk with the last part of the program ...
    (perl.beginners)
  • Re: finding out my IP address..
    ... machines IP from anywhere by making the cgi write its output to file. ... Hit the cgi from test machine then hit the generated webpage from ... print FILE " ...
    (perl.beginners)
  • Re: [PHP] Re: Scratch that
    ... look into rewriting it to be more reusable ... it's CGI, it can be executed using perl on the shell, sometimes - ... CGI must be executed to work, ... going to be executed via the web (definately a hit) or the shell ...
    (php.general)