Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8058755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:27:07+00:00 2026-06-05T09:27:07+00:00

I have the following session timeout setup: $inactive = $Timeout; // check to see

  • 0

I have the following session timeout setup:

$inactive = $Timeout;

// check to see if $_SESSION['timeout'] is set
if(isset($_SESSION['timeout']) ) {
    $session_life = time() - $_SESSION['timeout'];
    if($session_life > $inactive) { 
        session_destroy(); 
        header("Location: index.php?page=login"); 
    }

}

$Timeout is obtained from a database entry. At the moment it is set to 1800.

And every time a user clicks on a link or carries out an action, I do

$_SESSION['timeout'] = time();

On MAMP it’s working as expected, and the session is expiring after 30 minutes of inactivity.

On the hosted account (ipower) it seems to be timing out after about 5 mins of inactivity.

I am stumped as to what could be causing this? Has anyone experienced something like this? What settings could I check?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:27:08+00:00Added an answer on June 5, 2026 at 9:27 am

    Probably you have session.gc_maxlifetime set to different value on your MAMP and on other hosting environment session.gc_maxlifetime is set to default value.

    See http://www.php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime

    I did some search and it seems to be a problem with ipower try this,

    In order to run PHP sessions on iPower, you must add the following line of code to the top of any PHP script that uses sessions:

    session_save_path('/path_to_your_home_dir/dir_to_use_for_session_data');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following script validation.php <?php if(!isset($_SESSION['userId'])){ session_destroy(); header('Location: home.php'); exit; } ?>
I have the following excerpt from my global.asa that should set the session timeout
I have the following pages: page1.php <?php if (isset($_GET['link'])) { session_start(); $_session['myvariable'] = 'Hello
I have a header.html which start with session_start();. Then the following code, $_SESSION['cart'][$sw_id] is
I have a account page configured like the following; if(!isset($_SESSION[myusername])){ then show some login
I have a the following in my header.html: <META HTTP-EQUIV=refresh CONTENT=<%= session.getMaxInactiveInterval() %>; URL=/nmt/extranet/asp/error.jsp
HOW DO I SET THE HIBERNATE SESSION TIMEOUT IN JBOSS-SEAM? I Have an upload
Say I have the following query ICriteria query = session.CreateCriteria(typeof(T)); How can I find
I have the following Nhibernate LINQ query: var query = from c in session.Query<Customer>()
I have the following code. <s:push value=#session['person']> <s:if test=%{admin=='y'}> <a class=add href=/projit1/project/addProject.jsp>Create a Project</a>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.