Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> cookies z php 4.3.10-18 kontra przeglądarki, RFC2109 jest niekiepskie
and133and133
post 9.01.2007, 03:47:08
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 29.01.2006

Ostrzeżenie: (0%)
-----


Jezli ktos z Was próbowal zrozumieć opis nagłowka HTTP (RFC2616 + RFC2109) moze wypowie sie czy przedstawiona ponizej linia z listingu jest prawidłowo zapisana tak aby kazda przegladarka ja rozpoznała questionmark.gifquestionmark.gif (listing przedstawiony jest nizej)
Dodam ze test był przeprowadzony na php 4.3.10-18 - reszta jest w listingu

Set-Cookie: dVerifyUser=02%3A17%3A44-d-; expires=Tue, 09 Jan 2007 03:34:24 GMT; path=/

Przedstawiam kod php ktorym "wywolywalem naglówki".

  1. plik test6.php
  2. <?
  3. ++$_SESSION['q'];
  4. setcookie('cVerifyUser', $_SESSION['q']) or die('aaaaaaaaaaaaaaaaaaaaaaaaa');
  5. setcookie('dVerifyUser', date("H:i:s").'-d-', time()+8200 ,'/') or die('aaaaaaaaaaaaaaaaaaaaaaaaa');
  6. setcookie('eVerifyUser', 'tyryryryt-e-', 1000, '/') or die('aaaaaaaaaaaaaaaaaaaaaaaaa');
  7.  
  8. echo '<pre>';
  9. print_r($_COOKIE);
  10. echo '</pre>';
  11. ?>



efekt wywolania przegladarka OPERA jest jest taki :

Kod
Array
(
    [SID] => 68b38668ffdddcc5f93ab8d48c03d9a7
    [cVerifyUser] => 5
)



a wywołanie tej samej strony przez MOZILLA :

Kod
Array
(
    [SID] => c543f13089ef56d6a9b4e85f54504911
    [cVerifyUser] => 5
    [dVerifyUser] => 02:39:08-d-
)


--------------------------------------------- listing -----------------------------------------------
GET /test6.php HTTP/1.1
Host: www.xxxxxxxxx.pl
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915
Accept: application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive

HTTP/1.1 200 OK
Date: Tue, 09 Jan 2007 01:17:22 GMT
Server: Apache/1.3.33 (Debian GNU/Linux)
Set-Cookie: SID=fe277b4a3eaf736ec71f37250522efec; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: cVerifyUser=1
Set-Cookie: dVerifyUser=02%3A17%3A44-d-; expires=Tue, 09 Jan 2007 03:34:24 GMT; path=/
Set-Cookie: eVerifyUser=tyryryryt-e-; expires=Thu, 01 Jan 1970 00:16:40 GMT; path=/
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-2
-------------------------------------- koniec --------------------------------------------------------------

Ten post edytował and133and133 9.01.2007, 04:15:21
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 19.07.2025 - 05:49