Actually, I'm using session so that the user never has the data.
I store the data in the session (which the client can't access/modify) and then reference the session via a cookie stored in the client's browser (which is standard practice, I believe).
I'm trying to set it up so that the session can contain data that will otherwise require me to do a number of different database queries for every single one of my scripts.
It comes down to:
- Either I do it via sessions, if possible
OR
- Every script of mine will have to do a number of db queries every time they're executed.
I'm assuming sessions is a more efficient way of doing it, if I can store the necessary data.
Theoretically I could store it into the session using several dozen params, but for simplicity in the scripting, I was hoping to store it into the session in the form of a hash, so that I don't have to have 20-30 lines of param retrieval for every script. And it would also allow for much simpler coding since a lot of my scripts react differently, based on the data passed to them from the session.
One line making reference to a hash within a hash...
ie.
%access = $session->param("access");
$loggedIn = $access{sports}{soccer};
vs.
taking in the param that was broken into an array, rebuilding the hash from the arrah contents, then doing that line.
is a lot easier to manage, and a lot nicer coding.
I'm assuming, from your response, though that it's not possible to store a param in a manner which it will easily be retrievable as a hash.
I suppose I'll just have to write a subroutine in a library and then call it at the beginning of all of my scripts then.
*sigh*
Thanks for the info. I appreciate the response, even though I'm dissapointed to hear the answer... heh heh. I can dream, can't I? LOL
Stenyj
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.