Skip to content

PHP Session, cookie lifetime #60

Description

@jsolowiej

Hi,
I followed session implementation from your book. As far as I can see, you set up session cookie in a way:
session_set_cookie_params($lifetime, $path, $domain, $secure, $httponly); < PhpSession.php
that session gets expired after $lifetime, regardless if user performs some action in the mean time.
What if we would like session to expire after one hour of user inactivity only? We would need to update Expiration Date/Time after each action within a session timout, something like:
setcookie(session_name(),session_id(),time()+$lifetime);

What would be the best way to implement this feature?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions