Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^6: CGI and persistent data

by astroboy (Chaplain)
on Sep 01, 2009 at 00:26 UTC ( #792495=note: print w/replies, xml ) Need Help??

in reply to Re^5: CGI and persistent data
in thread CGI and persistent data

I'm not clear how FastCGI works in this case. Can you provide a code example?

Replies are listed 'Best First'.
Re^7: CGI and persistent data
by bv (Friar) on Sep 01, 2009 at 01:54 UTC

    Unfortunately, I haven't used FastCGI myself, so I can't produce code, but my understanding of the process is this: A FastCGI program runs persistently, handling its own forking, and communicates with the Web server over a socket. A regular CGI app is run from scratch every time it is invoked, but a FastCGI is already running (and can have its own objects in memory) when the Web server hands of a request to it. See FastCGI for more info, and check FastCGI for modules.

    print pack("A25",pack("V*",map{1919242272+$_}(34481450,-49737472,6228,0,-285028276,6979,-1380265972)))
      I'm not sure this will solve the OP's problem. If the FastCGI program saves its state to some global variables between requests, the next request might be from a different user. I think you'll still need to maintain session state that will be tied to a specific user

        True, you'll need to maintain session state yourself. A trivial example (that has plenty of bugs):

        print "<p>Hello, ", $session{$cookie}->{name}, ", welcome back</p>"
        print pack("A25",pack("V*",map{1919242272+$_}(34481450,-49737472,6228,0,-285028276,6979,-1380265972)))

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://792495]
[shmem]: choroba: the correct spelling is corretto
[shmem]: ...for espresso
[LanX]: due coretti, per favore! ;-)
[shmem]: grappa, ginebra o amaretto?
[shmem]: LanX: tried strange stuff wrt autocomplete. No luck :(

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2017-03-28 12:11 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (330 votes). Check out past polls.