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

  • Home
  • SEARCH
  • 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 8287107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:56:45+00:00 2026-06-08T11:56:45+00:00

I have a descent set up going for a user logging in and theres

  • 0

I have a descent set up going for a user logging in and theres a session time() and a few other things added to a table.

The issue i have is that when the user closes the browser it dosent delete the session from the mysql table.

From the users perspective its fine because they have to login again when they open the browser.

But for the super-users dashboard it still shows the user is logged in if they close the browser.

I did have a look at the close browser alert javascript code but i would rather find a way doing it without that.

I then thought maybe a cron script but that could log a user out unless i was updating the time() each time they clicked another page. Is that the only way?

  • 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-08T11:56:46+00:00Added an answer on June 8, 2026 at 11:56 am

    I wouldn’t trust the browser telling you it was closing.

    The only way is to do it on the server.

    Try recording the current time against the session every time it gets validated – this will be the sessions last access time.

    Then you can remove all sessions that exceed some time period you’ve decided on. You can either do this via a cron job, or add it to the session validation code and every user can help keep the table tidy.

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

Sidebar

Related Questions

I have a recursive-descent tree object. I want to be able to set a
How do recursive ascent parsers work? I have written a recursive descent parser myself
I have been struggling to think of some decent uses for things like vectors
We have a decent set of unit tests on our code and those unit
I have a decent admin script working for checking what IPs are logging on
SO I have the following set of code parsing delicious information. It prints data
SO I have the following set of code parsing delicious information. It prints data
I have an issue where I am trying to make a content box that
I'm having an issue where I have a local Wordpress install on my Ubuntu
I have a table and I want to deny its modification to all users

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.