What I do for a persistant ftp connection with Net::FTP for Web-FTP is I do the login in a cgi, then I fork off a daemon, which opens a unix socket, the cgi then passes back the location of that socket in a cookie or on the url. Successive calls back call a cgi that simple talks to that unix socket, passing data back and forth. It works quite well.