Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re^2: Falling for the same trap - since 1942

by Ovid (Cardinal)
on Jul 15, 2003 at 00:11 UTC ( [id://274234]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Falling for the same trap - since 1942
in thread Falling for the same trap – since 1942

Could you expand on that because I'm just not buying it. To me, session objects are great and I'm happy to use them, but it's important to remember that a session object, like any object, should be limited in scope to what's it's trying to conceptually represent.

For example, it seems reasonable that the object would have the expiration time (tracked in the database and not the cookie) and a user object for representing the user for whom the session is being maintained (again, the key to that would be in the database). Anything else would be superfluous. Thus, it seems to me that the complaints about session objects are actually about using poorly designed objects. Is there something I am missing?

Cheers,
Ovid

Looking for work. Here's my resume. Will work for food (plus salary).
New address of my CGI Course.

Replies are listed 'Best First'.
Re^4: Falling for the same trap - since 1942
by Aristotle (Chancellor) on Jul 15, 2003 at 08:34 UTC
    To me, session objects are great and I'm happy to use them, but it's important to remember that a session object, like any object, should be limited in scope to what's it's trying to conceptually represent.

    That is pretty much the point. I use global variables all the time, too, you know. :-) But they're limited to storing truly global state. So should be session objects. Sigletons are a useful pattern as well; but the same cautions apply.

    Just like with globals, singletons, or (in another context) gotos, the problem is not in technique/tool itself, and more in how people commonly use them.

    Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2024-03-28 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found