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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:05:58+00:00 2026-06-03T20:05:58+00:00

I am working on php project. All I want to do that, when I

  • 0

I am working on php project. All I want to do that, when I close the browser so unset or destroy the session.

Here I also tried

ini_set(‘session.cookie_lifetime’, 0) and session_set_cookie_params(0) before session_start();

It’s working fine in Windows os but not in MAC os.

Thanks in Advance.

  • 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-03T20:05:59+00:00Added an answer on June 3, 2026 at 8:05 pm

    There are two parts to a session.

    1. The data stored on the server
    2. The cookie with the session id on the client

    There is no reliable way to delete the data on the server when the browser is closed. Every sane session system just cleans up old data periodically (if there has been no sign of the associated browser for N minutes).

    The cookie on the browser is usually sent without an expiry time, which means it will expire when the browser exits. This works reliably.

    If whatever you have is doing what you want on Windows clients, then I would assume that you are talking about expiring the cookie.

    This will happen on Mac as well as Windows. My best guess is that there is a problem with your testing. On Windows, applications generally exit when the last window is closed. On Mac, applications generally require that you explicitly quit them but remain open if you just close the last window.

    To make sure the cookie expires you must expressly exit the browser (by picking Quit from the menu or right clicking and picking exit on the icon in the Dock).

    There is no way for the server to detect when the last window has been closed and kill the session remotely.

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

Sidebar

Related Questions

Here's my situation: I'm working on a PHP project that uses a few functions
I am working on a php project that needs to store information about various
I am working on a PHP project where I want to be able to
I am working on PHP project that should fetch emails from IMAP server, and
I'm actually working on a PHP project that will feature a user system (Login,Register,Send
What do I want to achieve? We are currently working on a PHP project
I am currently working on an html and php project. What I want to
Im working on a PHP project that involves selecting a song, hitting the submit
I am on Linux, working on forking a PHP project. I want to create
I'm working on a PHP project with several developers, each who has their own

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.