Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

How to Maintain State Information

by Nik (Initiate)
on Jun 27, 2004 at 14:42 UTC ( [id://369961]=perlquestion: print w/replies, xml ) Need Help??

Nik has asked for the wisdom of the Perl Monks concerning the following question:

I was curious as to what method people use to maintain session information in CGI scripts. When a user goes from page to page on my site, each page is processed by a cgi script. What is the best way to maintain state and login information? Should I create a file that contains a random key along with the user login and use that to carry state information? Or should I add a row to a database table for each user in maintaining state? In other words, is database access or file access going to be faster?

Up until now i udes cookies but this isnt best way because most people dont allow cookies to bes tored to theit pc through the browser. Whats do you suggest? Can you give me an example?
The Devil Is In The Details!

Replies are listed 'Best First'.
Re: How to Maintain State Information
by valdez (Monsignor) on Jun 27, 2004 at 15:02 UTC
Re: How to Maintain State Information
by bassplayer (Monsignor) on Jun 27, 2004 at 15:04 UTC
    I was curious as to what method people use to maintain session information in CGI scripts. When a user goes from page to page on my site, each page is processed by a cgi script. What is the best way to maintain state and login information? Should I create a file that contains a random key along with the user login and use that to carry state information? Or should I add a row to a database table for each user in maintaining state? In other words, is database access or file access going to be faster?
    What was wrong with the answer to the FAQ that you 'borrowed' (verbatim, I might add) this question from?

    Also, Super Search or even a regular title search reveals many nodes on this subject...

    bassplayer

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: How to Maintain State Information
by l3nz (Friar) on Jun 27, 2004 at 20:07 UTC
    You usually don't store the *actual* data on the client cookie, but you store a session cookie that will point to some place on disk where you keep the session data stored. A number of utilities around help automating this. If you cannot store a cookie on the client, you usually add the session information in a hidden variable, more or less like PHP does with PHPSESSIONID.....

    This is the general idea. Then, as you say, the devil is in the details. :-)

    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://369961]
Approved by valdez
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-28 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found