Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How Session IDs Are Transferred on Your Web Server
How Session IDs Are Transferred on Your Web Server? - PHP Script Tips - Understanding and Using Sessions
✍: FYIcenter.com
As you know there are two options the PHP engine can use to transfer session IDs to the client browsers. But how to do know which option is your PHP engine is using? The PHP sample script will help you to find out:
<?php
session_start();
print("<html><pre>");
$queryString = $_SERVER["QUERY_STRING"];
print("Query string of the incoming URL: ".$queryString."\n");
print("Cookies received:\n");
foreach ($_COOKIE as $name => $value) {
print " $name = $value\n";
}
$myLogin = $_SESSION["MyLogin"];
print("Value of MyLogin has been retrieved: ".$myLogin."\n");
$myColor = $_SESSION["MyColor"];
print("Value of MyColor has been retrieved: ".$myColor."\n");
print("</pre></html>\n");
?>
You need to save this script to your Web server as next_page.php. Now visit first_page.php and click the "Next Page" hyper like, you will get something like this:
Query string of the incoming URL: PHPSESSID=meml483hk4dvm1n2ii8k9hvjj1 Cookies received: Value of MyLogin has been retrieved: FYICenter Value of MyColor has been retrieved: Blue
Base on the output, your PHP engine is using URL parameters to transfer session IDs, because you can see the session ID parameter in the query string of the incoming URL, and there is no cookies related to session ID.
Another way to confirm that your PHP engine is using URL parameters to transfer session IDs is to look at the address field of your browser, it will show something like:
http://localhost/next_page.php?PHPSESSID=meml483hk4dvm1n2ii8k9hvjj1
2007-04-18, 5309👍, 0💬
Popular Posts:
How do we host a WCF service in IIS? Note: - The best to know how to host a WCF in IIS is by doing a...
How can method defined in multiple base classes with same name be invoked from derived class simulta...
How Are Vertical Margins between Two Block Elements Collapsed? - CSS Tutorials - Understanding Multi...
it will be very helpful if you send some important Questions with Answers of DBMS Tell us what types...
What is the concept of XPOINTER? XPOINTER is used to locate data within XML document. XPOINTER can p...