Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Koniec sesji jak przywrócić zawartośc pola tekstowego
amii
post
Post #1





Grupa: Zarejestrowani
Postów: 728
Pomógł: 76
Dołączył: 12.06.2009

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


Chciałbym zrobić coś takiego jak na forum php.pl czyli przywrócenie zawartości pola tekstowego po upływie sesji. To co wymyśliłem to sprawdzanie warunku dla czasu upłynięcia sesji. Nie wiem tylko jak 'ugryźć' tą część z przywracaniem zawartości pola txt.
Pomysły jakie mam to okresowy zapis zawartości pola do zmiennej za pomocą JS i AJAX. Any ideas ?

  1. if(!session_is_registered('pole_tekstowe')) { //jeśli sesja minęła to... trzeba przywrócić zawartość pola tekstowego
  2.  
  3.  
  4. }



Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
wNogachSpisz
post
Post #2





Grupa: Zarejestrowani
Postów: 1 233
Pomógł: 87
Dołączył: 6.03.2009

Ostrzeżenie: (40%)
XX---


Jeśli chodzi o tylko jedno pole, to można pokusił się o wrzucenie do cookie...

Kod
5.3  Implementation Limits

   Practical user agent implementations have limits on the number and
   size of cookies that they can store.  In general, user agents' cookie
   support should have no fixed limits.  They should strive to store as
   many frequently-used cookies as possible.  Furthermore, general-use
   user agents SHOULD provide each of the following minimum capabilities
   individually, although not necessarily simultaneously:

      *  at least 300 cookies

      *  at least 4096 bytes per cookie (as measured by the characters
         that comprise the cookie non-terminal in the syntax description
         of the Set-Cookie2 header, and as received in the Set-Cookie2
         header)

      *  at least 20 cookies per unique host or domain name


Czyli przeglądarka powinna pozwolić na ustawienie 20 cookiesów po 4096 bajtów każdy...
Powinno Wystarczyć.
Oczywiście nie polecam, to rozwiązanie tylko dla prawdziwych twarcieli i wymiataczy (IMG:style_emoticons/default/smile.gif)

Troche poczytałem. Okazuje się że jest wiele więcej metod na przechowywanie danych po stronie klienta.

Kod
flash: Flash 8 persistent storage.
gears: Google Gears-based persistent storage.
localstorage: HTML5 draft storage.
whatwg_db: HTML5 draft database storage.
globalstorage: HTML5 draft storage (old spec).
ie: Internet Explorer userdata behaviors.
cookie: Cookie-based persistent storage.


Do pobrania:
http://pablotron.org/?cid=1557

Pod FF i Opera działa mechanizm "localstorage", do 5MB..
http://frontend.pl/2010/04/w-strone-offline-localstorage/

Ten post edytował wNogachSpisz 5.03.2011, 05:38:54
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: 7.10.2025 - 19:58