How to configure the session timeout in PHP?

Solution Verified - Updated -

Issue

  • I want to implement session timeout for my PHP application.
  • The PHP application session should expire after a defined interval, and any subsequent click or reload should redirect to another configured (e.g. a login) page.

Environment

  • Red Hat Enterprise Linux
    • 6
    • 7
    • 8
    • 9
  • Microsoft Windows
  • PHP
    • php
    • rh-php

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content