session management thoughts

From: Date: Mon, 07 Jun 1999 15:23:26 +0000
Subject: session management thoughts
References: 1 2 3  Groups: php.version4 
Request: Send a blank email to php-version4+get-1362@lists.php.net to get a copy of this message
Sasha, These are just some brainstorming ideas that came to mind for session management. Maybe I can bring up some valid concerns or ideas through all this mess, or you can just ignore it :-) 1) passing the session_id What methods of passing the session_id are going to be available? Is browser cookies the only one? Another alternative would be to pass the session_id in the URL somehow. This is a bit tricky, since it requires the PHP programmer to specifically include the session_id in any form action or link on the web page. Maybe have a special variable $session_url that could be used to pass that data like so: <form method=post action="$session_url"> <a href="$session_url">click me</a> Of course, this method would require that the name of the script be imbedded in the variable. Maybe pass it in PATH_INFO like so: <form method=post action="script.phtml/$session_data/"> In this case, $session_data would need some type of identifier for PHP to recognize it as the session info. I've seen one language use the plus "+" sign as an identifier like this: <form method=post action="script.phtml/+ws3jroifdfs/"> This method also makes every single URL unique, even across sessions, which can be good and bad. Good for page caching, bad for web stats. Another method would be to pass the session_id as a variable: <form method=post action="script.phtml/?session_id=$session_id"> Whatever is used, there may be a bit of a learning curve for the PHP developer to remember the proper way to pass session data if they don't want to use cookies. 2) the session data itself An alternative to keeping the session data on the web server is to pass the session data encoded in the URL. I'm not sure how useful this could be, but it's an idea. One thing that comes to mind is if you are in an SQL loop (like search results), and you have the row identifier registered as a session variable. The same method of encoding could be used here too: /+wdoijfwoiefj/ A combination of both passing session_id and the session data in the URL would be possible with this method too. Monte

« previous php.version4 (#1362) next »