Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Ustawianie parametru sesj
dopy
post
Post #1





Grupa: Zarejestrowani
Postów: 80
Pomógł: 0
Dołączył: 25.07.2005

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


Witam,

W jaki sporob ustawiali byscie domene dla sesji zeby trzymało sesje dla subdomen dla *.domena.pl ?

Chodzi o ta funkcje: http://pl.php.net/session_set_cookie_params

Ustawiam w ten sposób:
  1. <?php
  2. session_set_cookie_params(54000,'/','.domena.pl');
  3. ?>


Ale jakoś po przejściu na inną subdomene gubi mi sesje.

Czy ktoś tutaj korzysta z tej funkcji i byłby w stanie nakierować mnie na właściwą drogę ? Niestety w manualu nie ma zbyt przydatnych przykładów.

Pozdrawiam.

Ten post edytował dopy 1.05.2006, 21:12:21
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
GrayHat
post
Post #2





Grupa: Zarejestrowani
Postów: 566
Pomógł: 18
Dołączył: 23.08.2003
Skąd: Łomża

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


wydaje mi sie ze musisz okreslic konkretna subdomene

Cytat
Something that has taken me some time to debug: session_set_cookie_params() does not work when the domain param is just a one level domain, like it was a TLD.

I have a site in an intranet and our internal domain is .local, so trying to set the cookie session to the .local domain does not work:

session_set_cookie_params(0, '/', '.local'); // Does not work

In all test I've done, setting the domain only works for SLDs and above:

session_set_cookie_params(0 , '/', '.sld.local'); Does work

This is nothing to do with php but the http protocol, witch does not permit setting cookies for TLDs for obvious security
Go to the top of the page
+Quote Post
ave
post
Post #3





Grupa: Zarejestrowani
Postów: 117
Pomógł: 2
Dołączył: 29.01.2004
Skąd: Rz-ów

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


a tak ?
  1. <?php
  2. ini_set('session.cookie_domain','.domena.pl');
  3. ?>


Ten post edytował ave 3.05.2006, 18:32:28
Go to the top of the page
+Quote Post

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: 21.12.2025 - 07:50