rfc1867_sid_cookie.phpt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. --TEST--
  2. session rfc1867 sid cookie
  3. --INI--
  4. file_uploads=1
  5. upload_max_filesize=1024
  6. session.save_path=
  7. session.name=PHPSESSID
  8. session.use_strict_mode=0
  9. session.use_cookies=1
  10. session.use_only_cookies=0
  11. session.upload_progress.enabled=1
  12. session.upload_progress.cleanup=0
  13. session.upload_progress.prefix=upload_progress_
  14. session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS
  15. session.upload_progress.freq=0
  16. session.save_handler=files
  17. --EXTENSIONS--
  18. session
  19. --SKIPIF--
  20. <?php include('skipif.inc'); ?>
  21. --COOKIE--
  22. PHPSESSID=rfc1867-sid-cookie
  23. --GET--
  24. PHPSESSID=rfc1867-sid-cookie-get
  25. --POST_RAW--
  26. Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
  27. -----------------------------20896060251896012921717172737
  28. Content-Disposition: form-data; name="PHPSESSID"
  29. rfc1867-sid-cookie-post
  30. -----------------------------20896060251896012921717172737
  31. Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS"
  32. rfc1867_sid_cookie.php
  33. -----------------------------20896060251896012921717172737
  34. Content-Disposition: form-data; name="file1"; filename="file1.txt"
  35. 1
  36. -----------------------------20896060251896012921717172737
  37. Content-Disposition: form-data; name="file2"; filename="file2.txt"
  38. 2
  39. -----------------------------20896060251896012921717172737--
  40. --FILE--
  41. <?php
  42. session_start();
  43. var_dump(session_id());
  44. var_dump(basename(__FILE__) == $_POST[ini_get("session.upload_progress.name")]);
  45. var_dump($_FILES);
  46. var_dump($_SESSION["upload_progress_" . basename(__FILE__)]);
  47. session_destroy();
  48. ?>
  49. --EXPECTF--
  50. string(%d) "rfc1867-sid-cookie"
  51. bool(true)
  52. array(2) {
  53. ["file1"]=>
  54. array(6) {
  55. ["name"]=>
  56. string(9) "file1.txt"
  57. ["full_path"]=>
  58. string(9) "file1.txt"
  59. ["type"]=>
  60. string(0) ""
  61. ["tmp_name"]=>
  62. string(%d) "%s"
  63. ["error"]=>
  64. int(0)
  65. ["size"]=>
  66. int(1)
  67. }
  68. ["file2"]=>
  69. array(6) {
  70. ["name"]=>
  71. string(9) "file2.txt"
  72. ["full_path"]=>
  73. string(9) "file2.txt"
  74. ["type"]=>
  75. string(0) ""
  76. ["tmp_name"]=>
  77. string(%d) "%s"
  78. ["error"]=>
  79. int(0)
  80. ["size"]=>
  81. int(1)
  82. }
  83. }
  84. array(5) {
  85. ["start_time"]=>
  86. int(%d)
  87. ["content_length"]=>
  88. int(%d)
  89. ["bytes_processed"]=>
  90. int(%d)
  91. ["done"]=>
  92. bool(true)
  93. ["files"]=>
  94. array(2) {
  95. [0]=>
  96. array(7) {
  97. ["field_name"]=>
  98. string(5) "file1"
  99. ["name"]=>
  100. string(9) "file1.txt"
  101. ["tmp_name"]=>
  102. string(%d) "%s"
  103. ["error"]=>
  104. int(0)
  105. ["done"]=>
  106. bool(true)
  107. ["start_time"]=>
  108. int(%d)
  109. ["bytes_processed"]=>
  110. int(1)
  111. }
  112. [1]=>
  113. array(7) {
  114. ["field_name"]=>
  115. string(5) "file2"
  116. ["name"]=>
  117. string(9) "file2.txt"
  118. ["tmp_name"]=>
  119. string(%d) "%s"
  120. ["error"]=>
  121. int(0)
  122. ["done"]=>
  123. bool(true)
  124. ["start_time"]=>
  125. int(%d)
  126. ["bytes_processed"]=>
  127. int(1)
  128. }
  129. }
  130. }