|
PODRĘCZNIK PHP 5.x, 4.x, 3.x - częściowo spolszczony / źródło: www.php.net
[Spis]
[A]
[B]
[C]
[D]
[E]
[F]
[G]
[H]
[I]
[J]
[K]
[L]
[M]
[N]
[O]
[P]
[Q]
[R]
[S]
[T]
[U]
[V]
[X]
[W]
[Z]
session_cache_expire (PHP 4 >= 4.2.0, PHP 5) session_cache_expire -- Zwróć bieżący czas przedawnienia pamięci podręcznej Opisint session_cache_expire ( [int nowy_czas] )
session_cache_expire() zwraca bieżące ustawienie
session.cache_expire. Zwrócona wartość podana jest w
minutach. Jeśli podany zostanie parametr
nowy_czas, bieżący czas przedawnienia
zostanie zamieniony na nowy_czas.
Czas przedawnienia jest ustawiany na wartość 180 przechowywaną w
session.cache_limiter w momencie startu. W związku z
tym niezbędne jest wywołanie session_cache_expire()
dla każdego żądania pobrania strony (zanim zostanie wywołane
session_start()).
Przykład 1. Przykład użycia session_cache_expire() |
<?php
session_cache_limiter('private');
$cache_limiter = session_cache_limiter();
session_cache_expire(30);
$cache_expire = session_cache_expire();
session_start();
echo "Ogranicznik pamięci podręcznej to $cache_limiter<br />";
echo "Znajdujące się w pamięci podręcznej strony sesyjne przedawnią się " .
"po $cache_expire minutach";
?>
|
|
Notatka:
Ustawienie nowy_czas ma efekt tylko jeśli
session.cache_limiter ma wartość
różną od nocache.
Patrz także:
session.cache_expire,
session.cache_limiter i session_cache_limiter().
User Contributed Noteslukasz at pilorz dot net
21-Nov-2005 02:49
I had a problem with session expiration time on a server where I didn't have access to php.ini. My solution was to use session_save_path with my own dir.
djmaze (AT) dragonflycms
23-Sep-2005 04:21
After recieving a "bogus" mark on a bug report i've tried to find out the differences between cache_expire and what was causing a session delete after 24 minutes.
cache_expire is used for cached session pages and has nothing to do with the session data
The garbage collector controls the session data and destroys sessions which are older then 1440 seconds (24 minutes) by default.
So to keep a session alive longer then 24 minutes (for example when a visitor tries to POST a huge message that took him 1 hour to type), you must modify the session.gc_maxlifetime thru ini_set()
Somehow i couldn't find anything in the PHP documentation regarding this and due to that me (and i think many others) got the wrong ideas regarding PHP sessions.
A few examples to fix session timeout are already posted below but in my opinion they all missed session.gc_maxlifetime
lance_rushing at hotmail dot com
17-Jun-2005 11:47
I've encountered the same problem of loosing focus when using IE and a javascript window.location.refresh/replace().
After fusing around I found that a <meta http-equiv="refresh" content="600"> works without move the focus on the parent frame's form. The down side is loading up the browser history and an annoying 'click' in IE on the page load.
bermi
|