development

PHP 세션 기본 시간 초과

big-blog 2020. 10. 26. 08:13
반응형

PHP 세션 기본 시간 초과


이 질문에 이미 답변이 있습니다.

PHP 세션이 기본적으로 시간 초과됩니까? 즉, 내 부분에 코딩이 없으면 사용자가 일정 시간 동안 활동하지 않으면 결국 "로그 아웃"됩니까?


서버 구성 또는 관련 지시문 session.gc_maxlifetime따라 다릅니다 php.ini.

일반적으로 기본값은 24 분 (1440 초)이지만 웹 호스트가 기본값을 다른 것으로 변경했을 수 있습니다.


웹 서버의 php-configuration에서 변경할 수 있습니다. 에서 검색 php.ini을 위해

session.gc_maxlifetime() 값은 초 단위로 설정됩니다.


예, 일반적으로 1440 초 (24 분) 후에 발생합니다.


http://php.net/session.gc-maxlifetime

session.gc_maxlifetime = 1440
(1440 seconds = 24 minutes)

php.ini에서 세션 시간 초과를 설정할 수 있습니다. 기본값은 1440 초입니다.

session.gc_maxlifetime = 1440

; NOTE: If you are using the subdirectory option for storing session files
;       (see session.save_path above), then garbage collection does *not*
;       happen automatically.  You will need to do your own garbage
;       collection through a shell script, cron entry, or some other method.
;       For example, the following script would is the equivalent of
;       setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
;          find /path/to/sessions -cmin +24 -type f | xargs rm

예, 일반적으로 세션은 PHP에서 20 분 후에 종료됩니다.

참고 URL : https://stackoverflow.com/questions/9904105/php-sessions-default-timeout

반응형