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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:56:37+00:00 2026-05-19T10:56:37+00:00

Session ID is stored on the client in a way that usually dissipates when

  • 0
  1. Session ID is stored on the client in a way that usually dissipates when the browser is closed (stored as a cookie?).
  2. Session ID and associated data is stored on the server (where?) for each client that starts one.

The main thing I wonder about is how the server knows when a session has ended, though. If the client no longer has the session ID stored (say, after closing their browser) and they try to ask the server for another session, it starts a new session. Does the server know to garbage collect the previous session data after some set amount of time? It seems to me like something that could be abused…

  • 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-19T10:56:38+00:00Added an answer on May 19, 2026 at 10:56 am
    1. Session ID is usually stored on client browser using a cookie (alternatively, in URL parameters, but this is not recommended, as explained in http://php.net/manual/en/session.security.php)
    2. Sessions are stored in the directory defined by session.save_path (e.g. /var/lib/php/sessions), or the system’s temporary directory if this is not set (usually /tmp).

    Sessions are garbage collected periodically, either by PHP itself during a request, or by a cron job (e.g. on Debian this is the default). See http://php.net/manual/en/session.configuration.php#ini.session.gc-probability

    The main thing I wonder about is how the server knows when a session has ended

    He doesn’t know. However he knows when a session has not been used since a certain period of time, so it can delete unused sessions.

    Does the server know to garbage collect the previous session data after some set amount of time?

    Yes. This is defined by the session.gc_maxlifetime ini setting. Any session older than that will be deleted during a garbage collect. Garbage collect frequency can be tuned with the session.gc_probability and session.gc_divisor ini settings. (See doc.)

    It seems to me like something that could be abused.

    If you mean that someone may be able to create too many staled sessions on the server; yes this is probably true.

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

Sidebar

Related Questions

I'm looking for a good way to visualize ASP.NET session state data stored in
Are $_SESSION variables stored on the client or the server?
I'm using ASP.NET, with session state stored out of process in SQL Server. When
When we add a variable to ASP.NET Session, where are those variables actually stored
I have a session class that needs to store session information in a MySQL
As you know, in ASP.NET, you can store session data in one of following
I am trying to pass data between two pages using Session State in ASP.NET.
I stored a variable in the session storage in php, how should I determine
First, a little background. I have two ASP.NET web applications that use SQLServer session
Tomcat (version 5 here) stores session information in memory. When clustering this information is

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.