Wuu Posted November 19, 2008 Report Share Posted November 19, 2008 (edited) if (isset($_COOKIE['www.xxx.lv.lang'])) { echo $_COOKIE['www.xxx.lv.lang']; } else { setcookie ("www.xxx.lv.lang", "LV", time()+60*60*24*30); echo "cepumiņi necepjas"; } visu laiku rāda ka cepumiņi necepjas :( Edited November 19, 2008 by Wuu Link to comment Share on other sites More sharing options...
bubu Posted November 19, 2008 Report Share Posted November 19, 2008 A ja bez trešā argumenta (tā visa time()+...) to pamēģina? Link to comment Share on other sites More sharing options...
andrisp Posted November 19, 2008 Report Share Posted November 19, 2008 Varbūt kaut kas tiek nosūtīts pārlūkam pirms kukiju uzsetošanas ? Un ja kļūdu rādīšana ir atslēgta, tad paziņojumu par to nevar redzēt. Link to comment Share on other sites More sharing options...
Wuu Posted November 19, 2008 Author Report Share Posted November 19, 2008 (edited) <?php session_start(); if (isset($_COOKIE['www.xxx.lv.lang'])) { echo $_COOKIE['www.xxx.lv.lang']; } else { setcookie ("www.xxx.lv.lang", "LV", time()+60*60*24*30); echo "cepumiņi necepjas"; } .... Nekādīgi neliekas! Mēģināju bez laika arī :( Pie phpinfo(); HTTP_COOKIE PHPSESSID=6eed089d0343a091dbcaa14b926f0bc5; www.xxx.lv.lang=LV atrod to cepumiņu WTF? Edited November 19, 2008 by Wuu Link to comment Share on other sites More sharing options...
e-remit Posted November 20, 2008 Report Share Posted November 20, 2008 Uzliec FF addonu FireCookie, lai vismaz pats zini, vai cepums nerakstās vai nelasās. Link to comment Share on other sites More sharing options...
Aleksejs Posted November 20, 2008 Report Share Posted November 20, 2008 pamēģini: print_r($_COOKIE); Vai šajā gadījumā arī rāda? Link to comment Share on other sites More sharing options...
Klez Posted November 20, 2008 Report Share Posted November 20, 2008 if (isset($_COOKIE['www.xxx.lv.lang'])) { echo $_COOKIE['www.xxx.lv.lang']; } else { setcookie ("www.xxx.lv.lang", "LV", time()+60*60*24*30); echo "cepumiņi necepjas"; } loģiski ka rādīs ka cepumiņi necepas ... ja šo else { setcookie ("www.xxx.lv.lang", "LV", time()+60*60*24*30); echo "cepumiņi necepjas"; } palabotu uz šo else { if (!setcookie ("www.xxx.lv.lang", "LV", time()+60*60*24*30)) echo "cepumiņi necepjas"; } varbuut ka straadaatu ? Link to comment Share on other sites More sharing options...
andrisp Posted November 20, 2008 Report Share Posted November 20, 2008 Klez, viņam jau problēma, ka pēc refreša nerādas, ka cepums eksistētu. Link to comment Share on other sites More sharing options...
marcis Posted November 20, 2008 Report Share Posted November 20, 2008 Varētu būt iespējams, ka cepumiņš netiek iecepts īstajā path`ā? Link to comment Share on other sites More sharing options...
Klez Posted November 20, 2008 Report Share Posted November 20, 2008 Pie phpinfo(); HTTP_COOKIE PHPSESSID=6eed089d0343a091dbcaa14b926f0bc5; www.xxx.lv.lang=LV atrod to cepumiņu WTF? tad sanaak ka tomeer liekas ... wuu, pameegini tiiraa failaa shito: <?php $value = 'something from somewhere'; if (!$_COOKIE['TestCookie']) { setcookie("TestCookie", $value); setcookie("TestCookie", $value, time()+3600); /* expire in 1 hour */ setcookie("TestCookie", $value, time()+3600, "/~rasmus/", ".example.com", 1); echo 'cepam'; } print_r($_COOKIE); ?> kad pirmo reizi atver man paraadiijaas shitais ... cepamArray ( [__utma] => 114651079.298212314.1209454124.1226573670.1226585082.20 [__utmz] => 114651079.1226573670.19.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) [phpSESSID] => d7d0f4cdf71b67ee6255fa0be543fbff ) otrajaa: Array ( [__utma] => 114651079.298212314.1209454124.1226573670.1226585082.20 [__utmz] => 114651079.1226573670.19.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) [phpSESSID] => d7d0f4cdf71b67ee6255fa0be543fbff [TestCookie] => something from somewhere ) Link to comment Share on other sites More sharing options...
Wuu Posted November 20, 2008 Author Report Share Posted November 20, 2008 Visiem paldies problēma atrasta! +60*60*24*30 vietā ierakstīju +2592000 Link to comment Share on other sites More sharing options...
andrisp Posted November 20, 2008 Report Share Posted November 20, 2008 Nevarētu būt, ka tā bija problēma. Link to comment Share on other sites More sharing options...
Wuu Posted November 20, 2008 Author Report Share Posted November 20, 2008 Ko tu vēlies dzirdēt? Labi bija vaina kaut kur citur ,tikai es neteikšu... Stulbi ,bet taisnība nezinu kas vainas tam 60*60.... Link to comment Share on other sites More sharing options...
Recommended Posts