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 8583507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:33:17+00:00 2026-06-11T21:33:17+00:00

I have a strange problem in my online test management system. Some users in

  • 0

I have a strange problem in my online test management system.

Some users in the test form (test.php) need long time to answer the question and submit the form.

After submitting the form the session is expired and user must login again

this is not a code problem

I set this value in top of all pages

ini_set('session.gc_maxlifetime', 18000);

Is there a way to refresh the session evrey 10 minutes without reloading the page in test form to prevent session expire?

Please help me

Thanks

  • 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-11T21:33:19+00:00Added an answer on June 11, 2026 at 9:33 pm

    You can use javascript XHR, or as others call it, AJAX.

    • http://api.jquery.com/jQuery.ajax/
    • http://api.jquery.com/jQuery.get/

    Using ajax you can call a php script that refreshes your session every 10 minutes. 🙂


    This is as far as i can go to “exact”.

    javascript

    var refreshSn = function ()
    {
        var time = 600000; // 10 mins
        setTimeout(
            function ()
            {
            $.ajax({
               url: 'refresh_session.php',
               cache: false,
               complete: function () {refreshSn();}
            });
        },
        time
    );
    };
    
    // Call in page
    refreshSn()
    

    refresh_session.php

    <?php
    session_start();
    
    // store session data
    if (isset($_SESSION['id']))
    $_SESSION['id'] = $_SESSION['id']; // or if you have any algo.
    ?>
    

    Anyway, another solution would be to extend the session time for the test page only using
    the solution presented here

    How do I expire a PHP session after 30 minutes?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange problem with php scripts - mysql_affected_rows() sometimes returns 0 for
I have some problem to implement twig extension. I need to create my own
I have a strange problem. I have a jQuery document.ready function executing some script
I have strange problem with XUL layouts. My current code: <xul:vbox> <xul:hbox> .. some
I have searched and searched and couldn't find the answer. I have strange problem,
I have strange problem. I have class which behaves similar dropdown list. package test.view;
i have strange problem doing reporting: i have numerous clients with different issued invoices.
I have strange problem with receiving data from socket. On client im using air
I have a strange problem on ipv6 connection. I write down a simple client
I have a strange problem with IE. I have a sequence of forms on

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.