Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> usuwanie ciasteczka po zamknięciu zakładki.
Szymon80
post 27.06.2010, 22:28:22
Post #1





Grupa: Zarejestrowani
Postów: 82
Pomógł: 1
Dołączył: 6.06.2009

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


Witam.

Potrzebuję skryptu js lub ew. php który usuwał by ciasteczko o nazwie 'ala', gdy zakładka przeglądarki na której jest dana strona zostanie zamknięta, lub user przejdzie na inną stronę z moje strony, albo cała przeglądarka zostanie zamknięta.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
Blame
post 28.06.2010, 15:03:26
Post #2





Grupa: Zarejestrowani
Postów: 678
Pomógł: 124
Dołączył: 26.09.2009

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


Przyda ci się zdarzenie window.onClose i żeby usunąć ciasteczko wystarczy mu ustawić datę z przeszłości jako datę ważności.


--------------------
Go to the top of the page
+Quote Post
wookieb
post 28.06.2010, 15:07:48
Post #3





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




http://pl.php.net/setcookie
Cytat
The time the cookie expires. This is a Unix timestamp so is in number of seconds since the epoch. In other words, you'll most likely set this with the time() function plus the number of seconds before you want it to expire. Or you might use mktime(). time()+60*60*24*30 will set the cookie to expire in 30 days. If set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes).


Ten post edytował wookieb 28.06.2010, 15:08:06


--------------------
Go to the top of the page
+Quote Post
Szymon80
post 29.06.2010, 00:56:20
Post #4





Grupa: Zarejestrowani
Postów: 82
Pomógł: 1
Dołączył: 6.06.2009

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


Dzięki z a pomoc.
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: 15.06.2025 - 13:53