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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:15:26+00:00 2026-06-12T03:15:26+00:00

I am trying to find out what is wrong with this code below, whenever

  • 0

I am trying to find out what is wrong with this code below, whenever I tried to logout using Internet Explorer, I could not able to do that, It only logs out after several reloads or after closing the browser.

 <?php
//Start session 
session_start();
require("../../class-settings.php");
function write_at_sess_destroy(){
    $time=date('h:i:s A',time());
    $sql="update " . DB_PRE."user_master set `guid` = '',`user_first_login`='0' WHERE user_id ='".  $_SESSION['user']."'";
    $sql_log= "update " . DB_PRE."user_log set logout_time='$time' where user_id='{$_SESSION['user']}' and logger_id='{$_SESSION['DYNAMIC_LOGGER_ID']}'";       
    if(mysql_query($sql))if(mysql_query($sql_log)) return true;
}
if(write_at_sess_destroy()){
    function unset_sessions(){
        session_start();
        if($_SESSION['adminlang'])unset($_SESSION['adminlang']);
        unset($_SESSION['loginID']);
        unset($_SESSION['utype']);
        return true;
    }
    if(session_destroy()){
        header("Location:../../../");
        exit;
    }
    else{
        echo "error...";    
    }
}
?>
  • 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-12T03:15:27+00:00Added an answer on June 12, 2026 at 3:15 am

    Why can’t you simplify:

    <?php
        session_start();
        require("../../class-settings.php");
        function write_at_sess_destroy(){
            $time=date('h:i:s A',time());
            $sql = "update " . DB_PRE."user_master set `guid` = '',`user_first_login`='0' WHERE user_id ='".  $_SESSION['user']."'";
            $sql_log = "update " . DB_PRE."user_log set logout_time='$time' where user_id='{$_SESSION['user']}' and logger_id='{$_SESSION['DYNAMIC_LOGGER_ID']}'";       
            if(mysql_query($sql))if(mysql_query($sql_log)) return true;
        }
        if(write_at_sess_destroy()){
            session_regenerate_id();
            session_destroy();
            $_SESSION = array();
            header("Location: ../../../");
            exit;
        } else {
            echo mysql_errno() . ": " . mysql_error() . "\n";
        }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to find out where I went wrong in the below code.
I'm trying to find out if a string contains css code with this expression:
I'm Trying to find Timezone for a Country by Using Below Code. // FIND
I'm trying the following and cannot find out what is wrong: IF( IFNULL( SELECT
I am trying to find out if an instance of an application (not vb.net)
What's wrong with this set of code? I have errors and I can't find
I'm trying to save an entity to my database using this code: public void
I am not sure how to find out more about whats wrong with my
I am trying to find out if a cookie exists or not, if it
I just spent 2 hours trying to find out what was wrong with my

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.