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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:37:30+00:00 2026-06-13T14:37:30+00:00

I have developed this PHP web application which is now running for some months.

  • 0

I have developed this PHP web application which is now running for some months. Suddenly one of the users complained that he was able to login, but the session was terminated as soon as he clicked on any button! The same problem happened on different browsers.

After some tests I realized that a brand new session ID was created every time the user clicked on any button, probably because the original session was expired.

For whatever reason I took a glance at the user’s computer clock and… surprise! His clock was 3 months in the future! I didn’t know if such thing could have any relation to the failure, but I did fix the clock. Still it didn’t work. I erased all cookies. Still nothing. So I restarted the browser – and then it started working again!

The closest information I got about this issue was Shimon Amit’s answer to this question. Good, now I know that the clock “misconfiguration” is the cause. The problem is… I cannot keep every customer’s computer clock under control. Some of them may have their computer clocks set in the future.

My question: is there any solution for this? Any trick? I don’t want customers to face such errors as they may find it “lame” and break their trust on the application, even though it’s not really my fault (in a sense).

  • 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-13T14:37:31+00:00Added an answer on June 13, 2026 at 2:37 pm

    You can extend your session timeout to a later date. Perhaps you can use cookies that don’t expire (sessions are related to cookies on the client side) Otherwise, your client’s browser is just doing what it’s designed to do.

    EDIT: Javascript Option

    This is a total hack, but you COULD use javascript to get the current time on the client machine and send it back to the server, then adjust the timeout on your session cookie to expire three months after that. See http://www.w3schools.com/jsref/jsref_gettime.asp

    Once you have retrieved the client time, you can reset the session expiration using session_cache_expire(). http://www.php.net/manual/en/function.session-cache-expire.php

    EDIT: 100% Server Side Option

    Another option that I thought of would be to set a session cookie with no expiration, but track the time the cookie was set on the server, say in a MySQL table. You would also need to keep track of the last activity. Whenever a logged in user makes a request, you could check the start time of their session and their last activity. If the current time is greater than your acceptable timeout for either of these, then destroy the session server side and bring them back to the log in page. If the session is still ok, then update the last activity associated with that user so you can compare on the next request. No client side code necessary.

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

Sidebar

Related Questions

I have developed a PHP-MySQL web application, which is a school-based project. My client
We have a web application which has been developed over the past 7 months.
I have developed a Phone Gap application using this link . Application is running
I have developed a Web service using WCF Service Application. This service application is
The issue is this: I have a web application that runs on a PHP
I have a PHP web application developed using symfony framework. I want to call
We have an Yii-based PHP application which does some generic actions (like Share with
I have developed a web application in PHP for a client. The client is
I have developed a Web Application in pyrocms and thats working perfectly. Now i
I have developed and android Application and export as APK file to publish this

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.