Cheap Web Hosting for Developers

PHP, MySQL, Java, Unix Cheap Web Hosting

HTTP and Sessions 125 Thus, the data needs

Filed under: Web Applications Development With PHP4.0 — webmaster @ 22:16

HTTP and Sessions 127 n It reveals that your pages are generated dynamically, and some search engines will refuse to index the pages at all. Other search engines will cut everything after the question mark from the URL. n The session ID will be added to users bookmarks and printouts.We even know of articles in technical journals that have the session ID of a Web site included as part of a reference. From a usability point of view, it s harder for users to manually alter the URL to find specific resources on a site. n The session ID is logged in proxy servers and shows up in the HTTP_REFERER CGI environment variable for other sites. Dynamic Paths Let s see if we can avoid some drawbacks of URL rewriting. For a start, you can add the ID to your URL in the Amazon.com way (see Figure 4.1) to make it look like http://server.com/page.php3/.With this method, the session ID is part of the path to the script, and the URL looks like a static page to search engines and spiders.This works because the Web server knows that page.php3 is a script, and stops looking further in the URL for files. But this way the session ID is not automatically available in your PHP script.You need to parse the path yourself to get access to it: function session_start_from_path() { global $HTTP_HOST, $REQUEST_URI; ereg( /([0-9a-z]{32}) , $REQUEST_URI, $regs); $session_id = $regs[1]; if(!isset($session_id) || empty($session_id)) { srand((double)microtime()*1000000); $session_id = md5(uniqid(rand())); $destination = http://$HTTP_HOST$REQUEST_URI/$session_id ; header( Location: $destination ); } session_id($session_id); session_start(); } All other drawbacks of URL rewriting still apply to dynamic paths, though.

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services

7 Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Cheap Web Hosting