Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [cookies] ciasteczka z glownej domeny na podstronach
Zmorcia
post
Post #1





Grupa: Zarejestrowani
Postów: 234
Pomógł: 5
Dołączył: 26.01.2008
Skąd: Lutcza

Ostrzeżenie: (20%)
X----


Jak to zrobi? Bo mam podstrony qba.costam.pl i ni widać tam cokies z costam.pl

pomoze ktos?

ps. Domeny tworze poprzz htaccess
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 19)
wookieb
post
Post #2





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




Przy setcookie dodajesz parametr domain 'costam.pl'
http://php.net/setcookie
Go to the top of the page
+Quote Post
Zmorcia
post
Post #3





Grupa: Zarejestrowani
Postów: 234
Pomógł: 5
Dołączył: 26.01.2008
Skąd: Lutcza

Ostrzeżenie: (20%)
X----


mi bardziej chodzi o sesje &^^
Pomylilem sobie nazwe ;p
Go to the top of the page
+Quote Post
wookieb
post
Post #4





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




...
Kod
ini_set('session.cookie_domain', 'costam.pl');


Ten post edytował wookieb 27.01.2009, 13:06:56
Go to the top of the page
+Quote Post
Zmorcia
post
Post #5





Grupa: Zarejestrowani
Postów: 234
Pomógł: 5
Dołączył: 26.01.2008
Skąd: Lutcza

Ostrzeżenie: (20%)
X----


nie wiemjakie to ma zastosowanie, i czy sesje bd dzialac wszedzie
Go to the top of the page
+Quote Post
wookieb
post
Post #6





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




Tzn ze zmienia domene ciasteczka tak ze id_sesji jest widoczna dla domeny 'costam.pl' i kazdej jej poddomeny. Ale oczywiscie wtedy jezeli dasz ten kod do kazdej poddomeny.
Go to the top of the page
+Quote Post
Zmorcia
post
Post #7





Grupa: Zarejestrowani
Postów: 234
Pomógł: 5
Dołączył: 26.01.2008
Skąd: Lutcza

Ostrzeżenie: (20%)
X----


Wkleiłem kod w sam head, strony i nie hula ^^
Go to the top of the page
+Quote Post
wookieb
post
Post #8





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




Cytat(Zmorcia @ 27.01.2009, 13:22:14 ) *
Wkleiłem kod w sam head, strony i nie hula ^^

Wstaw przed wywolaniem funkcji session_start()
Go to the top of the page
+Quote Post
Zmorcia
post
Post #9





Grupa: Zarejestrowani
Postów: 234
Pomógł: 5
Dołączył: 26.01.2008
Skąd: Lutcza

Ostrzeżenie: (20%)
X----


dalej nie chce chulać ^^
Go to the top of the page
+Quote Post
nospor
post
Post #10





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




pokaz moze kawalek kodu (kilka linii przed i kilka linii po ) jak ty wstawiasz ten kod
Go to the top of the page
+Quote Post
Zmorcia
post
Post #11





Grupa: Zarejestrowani
Postów: 234
Pomógł: 5
Dołączył: 26.01.2008
Skąd: Lutcza

Ostrzeżenie: (20%)
X----


  1. <?php
  2. ini_set('session.cookie_domain', 'domena-mar.pl');
  3.  
  4. include_once('system/safety/refresh_safety/exaBD.php');
  5.  
  6. include_once('system/functions/functions_main.php');
  7. include_once('system/functions/functions_up.php');
  8.  
  9.  
  10. include_once('system/functions/functions_content.php');
  11. include_once('styles/'.$system -> viewStyle().'/template/head.php');
  12. include_once('styles/'.$system -> viewStyle().'/template/leftmenu.php');
  13.  
  14. include_once('styles/'.$system -> viewStyle().'/template/contentup.php');
  15.  
  16. include_once('system/functions/functions_center.php');
  17. ?>


Ten post edytował Zmorcia 27.01.2009, 13:27:55
Go to the top of the page
+Quote Post
wookieb
post
Post #12





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




A wstawiłes to w KAZDEJ poddomenie? Przed KAZDYM wywolanim funkcji session_start?
Go to the top of the page
+Quote Post
Zmorcia
post
Post #13





Grupa: Zarejestrowani
Postów: 234
Pomógł: 5
Dołączył: 26.01.2008
Skąd: Lutcza

Ostrzeżenie: (20%)
X----


ten kod co ddałem, jest includowany przed każda podstroną (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
wookieb
post
Post #14





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




A spróbuj jeszcze
Kod
ini_set('session.cookie_domain', '.costam.pl');

Dodalem kropke przed domena,

EDIT//
Przecież napisalem PRZED session_start(). OmG

Ten post edytował wookieb 27.01.2009, 13:43:31
Go to the top of the page
+Quote Post
nospor
post
Post #15





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




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

Mow takiemu wstaw przed a ten wstawi po i mowi ze dal przed....
Go to the top of the page
+Quote Post
Zmorcia
post
Post #16





Grupa: Zarejestrowani
Postów: 234
Pomógł: 5
Dołączył: 26.01.2008
Skąd: Lutcza

Ostrzeżenie: (20%)
X----


proboweałem tez przed, nid działało.... a ten kod został z dysku
Go to the top of the page
+Quote Post
nospor
post
Post #17





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




ps: hihi, wkoncu se przypomniano o kropce (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Dopisz te kropke co podal wookieb i daj to przed
Go to the top of the page
+Quote Post
Zmorcia
post
Post #18





Grupa: Zarejestrowani
Postów: 234
Pomógł: 5
Dołączył: 26.01.2008
Skąd: Lutcza

Ostrzeżenie: (20%)
X----


nie chula ;P

obczajcie jeszcze plik ktory generuje podstrony

  1. <?php
  2. // includuje pliki z includes
  3. include_once('system/includes/includes_main_up.php'); // w tej linijsce jest kod który dałem powyżej
  4. sing_in();
  5.  
  6. $page = $_GET['p'];
  7.  
  8. if(!$page){
  9. include_once('system/includes/pages/index_index.php');
  10. } else {
  11. if (file_exists('system/includes/pages/index_'.$page.'.php')){
  12. include_once('system/includes/pages/index_'.$page.'.php');
  13. } else {
  14. include_once('system/includes/pages/index_error.php');
  15. }
  16. }
  17. // includuje pliki z includes
  18. include_once('system/includes/includes_main_down.php');
  19. ?>


// podstrony gfeneruje za pomoca .htaccess:

  1. <?php
  2. RewriteEngine On
  3.  
  4. RewriteRule ^img/(.*)$ images/advertisment/$1.png [L,NC]
  5. RewriteRule ^adv/(.*)$ images/advertisment/site/$1.gif [L,NC]
  6. RewriteRule ^img-small/(.*)$ images/advertisment/small/$1.png [L,NC]
  7. RewriteRule ^captha-([0-9]*).jpg$ system/main/captha.php [L,NC]
  8.  
  9.  
  10. RewriteCond %{SCRIPT_FILENAME} -f
  11. RewriteRule .* -
  12. RewriteCond %{HTTP_HOST} ^(.*).domena-mar.pl$
  13. RewriteRule ^$ /index.php?p=profile&i=%1
  14. ?>


Ten post edytował Zmorcia 27.01.2009, 13:38:01
Go to the top of the page
+Quote Post
wookieb
post
Post #19





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




Pokaż jak ostatecznie wstawiłeś ten kod. I czy napewno na każdej subdomenie. Dodatkowo wyczyść ciasteczka.

Ten post edytował wookieb 27.01.2009, 14:09:25
Go to the top of the page
+Quote Post
Zmorcia
post
Post #20





Grupa: Zarejestrowani
Postów: 234
Pomógł: 5
Dołączył: 26.01.2008
Skąd: Lutcza

Ostrzeżenie: (20%)
X----


Jesteście wielcy, działa... Wyczyściłem sesje i cookies... Wisze wam po Piwie (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)
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: 23.08.2025 - 20:47