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 To Test the Session Garbage Collection Process
How To Test the Session Garbage Collection Process? - PHP Script Tips - Understanding and Using Sessions
✍: FYIcenter.com
In order to test the session garbage collection process, you need to change the settings to expire session variables in 10 seconds and run the process on every request:
session.gc_probability = 1 session.gc_divisor = 1 session.gc_maxlifetime = 10
If you re-run the first_page.php and next_page.php scripts presented in the previous tutorials, you will see some thing like:
Query string of the incoming URL: Cookies received: PHPSESSID = grm557vicj1edmiikgsa8hbd11 Value of MyLogin has been retrieved: FYICenter Value of MyColor has been retrieved: Blue
Wait for 10 seconds, and start another browser window to run first_page.php. This is to triger the session garbage collection process to remove values stored in session grm557vicj1edmiikgsa8hbd11.
Go back to the first browser window on second_page.php, and click the browser refresh button, you will get something like:
Query string of the incoming URL: Cookies received: PHPSESSID = grm557vicj1edmiikgsa8hbd11 Value of MyLogin has been retrieved: Value of MyColor has been retrieved:
As you can see, session values are gone, the browser is still sending the same session ID as a cookie, but the all sesion values are expired (actually, the session file is removed by the garbage collection process).
2007-04-18, 5048👍, 0💬
Popular Posts:
How can I construct preprocessor if expressions which compare strings? You can't do it directly; pre...
.NET INTERVIEW QUESTIONS - Is versioning applicable to private assemblies? Versioning concept is onl...
How To Merge Cells in a Row? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells If you wan...
What is the difference between CALL_FORM, NEW_FORM and OPEN_FORM? CALL_FORM: start a new form and pa...
Where Do You Download JUnit? Where do I download JUnit? I don't think anyone will ask this question ...