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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:45:02+00:00 2026-05-23T18:45:02+00:00

I am looking for insights into how to destroy a specific session in PHP.

  • 0

I am looking for insights into how to destroy a specific session in PHP. Through a partner website a user logs into the main website using a token and obtains a full session.

It is also possible for the partner website to call a destroy function if the user logouts from the partner website. We should then also log out our own user.

What is the best approach to this? The Zend_Session destroy method does not accept a parameter, similarly the PHP function session_destroy does neither.

I am considering two options:

  1. Removing the session information directly from file/memcache but would prefer a “cleaner” approach than this.

  2. Checking at every page request if this is a “token” user ; and if then check if their token was expired by maintaining a list. This adds overhead to a busy website, but might be my only option.

Or is there a third / better approach I am not seeing?

  • 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-23T18:45:03+00:00Added an answer on May 23, 2026 at 6:45 pm

    If you wish to be able to ‘kick’ the sessions of a user(s), the only way you can do it is if you use MySQL (or someother db, sqlite even) for your session storage.

    Then you can simply remove entries from the db to kill a session.

    This also allows you do do things such as, ‘take control’ of a specific user’s session and other stuff 🙂

    See this for a very basic run through: http://www.devshed.com/c/a/MySQL/Custom-Session-Management-Using-PHP-and-MySQL/ (not the best example but good enough full example to start you).

    EDIT

    Also, if logging out through the partner site, another method I have used in the past (which was with O2 and other such sites) they were given a ‘callback’ (REST API call in most cases) which they would also need to call when the user logs out of their site.

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

Sidebar

Related Questions

I'm planning on using MEF within ASP.NET looking for some insight into thread safety
I'm looking for some insights into the layout system. Is anyone aware of a
Setup: I'm looking for insight into using a ABPersonViewContoller without getting data from the
I've been looking into using an iframe to sandbox some javascript for a site
I'm looking for some insight into XNA on Xbox 360, mainly if its possible
I'm looking for some insight into the workings of Silverlight - at this time
Looking at the C# project templates in VS2008 and the offerings are WPF User
I've started looking into architecturing a javascript framework. I don't want to reinvent the
While looking over various PHP libraries I've noticed that a lot of people choose
Ok, new coder here looking for a little insight into this problem. So I

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.