| Article: |
The PHP Scalability Myth | |
| Subject: | Hidden variables for session state? | |
| Date: | 2003-10-17 17:00:15 | |
| From: | anonymous2 | |
|
Response to: Hidden variables for session state?
|
||
|
Correct me if I'm wrong, but you seem to be suggesting a stateless presentation tier. Thus the session state must be moved either forward to the client (i.e., browser) or backward to the middle tier or (as you suggest) database. Let's consider each of these strategies:
|
||
Showing messages 1 through 2 of 2.
-
Hidden variables for session state?
2003-10-17 20:23:47 tarrant [View]
-
Hidden variables for session state?
2003-10-17 17:40:49 anonymous2 [View]
Yes, you're absolutely correct.... BEAUTIFULLY STATELESS! One must exploit the advantages of their preferred programming env. And, I must say you're correct about the DB thing too. Remember, however, being right doesn't mean that when an environment is exploited for it’s strongest attributes that it is weak. On the contrary, if we exploit an environment along it's strengths then we push said environment closer and closer to 100% efficiency.
Insofar as "The costs, however, are enormous, because potentially each request/response cycle results in an additional database write."...Potentially you are right.... and potentially you are wrong. It all depends on one's ability to design. I think in the end the lesson here is that we, as technologists, should design for two things: 1) to fulfill the business rules related to our implementation requirement AND 2) to take as much advantage of the programming environment as possible. If we don't we're just another bad example of the Edsel.



Actually, I've usually had a userid and sessionid in separate cookies, with the sessionid being a random number. If someone tries to use their sessionid but someone else's userid, then there's a system alert and the session token isn't vaild.