Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Set cookies dla wszystkich stron
mariolita
post
Post #1





Grupa: Zarejestrowani
Postów: 116
Pomógł: 10
Dołączył: 24.04.2015

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


Używam wamp server

mam folder główny w którym mam między innymi index.php kontakt.php itd

w głównym folderze mam folder o nazwie phpfile

i w nim plik który ustawia cookies:

setcookie("uzytkownik", "$email", time() + (86400 * 7));

i cookies faktycznie się ustawia ale tylko dla jedego pliku/strony w tym podfolderze phpfile

chciałbym żebym mógł odczytać wartość tego cookie na stronach w folderze głównym

jak to zrobić?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Arcioch
post
Post #2





Grupa: Zarejestrowani
Postów: 324
Pomógł: 110
Dołączył: 18.09.2012

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


A czy nie możesz zobaczyć jakie wartości ma funkcja setcookie w manulau (IMG:style_emoticons/default/smile.gif) LINK
Zobacz masz tam zmienna path, która powinna rozwiać Twoje problemy z ciasteczkami w jednym pliku (IMG:style_emoticons/default/smile.gif)

The path on the server in which the cookie will be available on. If set to '/', the cookie will be available within the entire domain. If set to '/foo/', the cookie will only be available within the /foo/ directory and all sub-directories such as /foo/bar/ of domain. The default value is the current directory that the cookie is being set in.
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 12.10.2025 - 17:16