/    Sign up×
Community /Pin to ProfileBookmark

PHP Page Session timeout?

Hi!

Can someone please let me know how to do,

[b]Automated PHP Page session expiration after a certain idle time (which user doesn’t interact with web page) [/b]

This is actually to protect an application from unauthorized access after leaving browser open without logging out.

I guess I have to do this with SESSIONS; but could not find a solution.

Thanks and Best Regards

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@salmanshafiqApr 22.2008 — Hello,

You could try adding these lines:

ini_set('session.cookie_lifetime', 0);

ini_set('session.gc_maxlifetime', 3600);

You should add them at the start of every page, or in the connection file since it will most probably included in all pages, and also appears before the session is started.

However, depending on your settings, this might not work.
×

Success!

Help @GUIR spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...