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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:29:52+00:00 2026-05-16T18:29:52+00:00

say i store some data associated with a session id in a database .

  • 0

say i store some data associated with a session id in a database . how do i delete the data when the session is timeout in php(i do not want to fill my file sever with all junk data.)?

is there any call back function to call in php ?

  • 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-05-16T18:29:52+00:00Added an answer on May 16, 2026 at 6:29 pm

    You can write php script

    <?php
    session_start();
    $query = "DELETE FROM session_data WHERE session_id = '{$_SESSION['session_id']}'";
    // in case you want to read this from ajax as json response
    echo mysq_query($query) ? "true" : "false";
    session_destroy();
    ?>
    

    and access this script with ajax on uload event with JQuery

    $(window).unload(function() {
        $.get('destroy_session.php', null, function(data, status) {
           // ignore result
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a .resx resource file to store some dictionary data, wich i want
I've got some financial data to store and manipulate. Let's say I have 2
Lets say i have a website mysite.com that will store some sensitive personal data
I have some data that I want to store somewhere in my Rails app
Let's say I'd like to split some data into 60-character parts and store them
I want to access an image stored in Blackberry, say at location store/home/user/image.png .
Say that I've got a web application that can store Persons in a database.
Let's say I want to store a group of function pointers in a List<(*func)>
Let's say I want to design a REST store used to manage a list.
Let's say I want to bit shift i twice to the left and store

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.