Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

On top of using CGI::Session and/or Apache::Session, persistent data is very easily handled in multiple ways.

You can store all relevant session data at the client, or you can store that data on the server. There are tradeoffs both ways:

On the client, you lighten server load. This can be an issue for heavily trafficed applications. It's also a potential security problem if someone learns how to edit their cookies. In a closed environment (Intranet) this is usually not such a problem.

You can also store that data server-side. Either in a flat file or a database... flat-files are extremely easy (Just name the file with the session id you toss to the client in a cookie) and flexible - it's easy to add data to them. Databases scale up to better load, but require more planning and architecture. They're also less flexible.

I prefer the second solution. This is pseudocode, something I use for "flowcharting" during the development process:

get sessionId from browser; if (no sessionId) create session id; hand to browser; create datastore; put relevant data in store (username, password, browser, etc) else get relevant data from datastore;

Pretty simple. Without knowing what kind of data you're needing to be persistent, that's about the best I can do. One other library you may be interested in is CGI::Application. It uses HTML::Template to separate code from the presentation layer (HTML), which may be a different paradigm than you're looking for, but it helps you maintain state between pages.


In reply to Additional Help by khudgins
in thread Which Web Solution? by sth

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found