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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:52:34+00:00 2026-05-27T00:52:34+00:00

I have an anchor that is a Log Out anchor when it is clicked,

  • 0

I have an anchor that is a “Log Out” anchor when it is clicked, I send it to another page that distroys the PHP session but the the “Login” information still shows after this like for example “Welcome Andrew”, I have to refresh the page once again so that it actually picks it up and then the “Welcome Andrew” changes to “Please Login”, what can I do so that when the anchor is clicked and it goes to that other page, it destroys the session and shows “Please Login” without having to refresh it?

<a href="logout.php"> Log Out</a>

Log Out PHP

<?php
    session_destroy();
?>

After it gets to logout.php, it still shows “Welcome Andrew” but if I refresh it shows “Please Log in” how can I do it so I dont have to refresh?

Thank you

  • 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-27T00:52:35+00:00Added an answer on May 27, 2026 at 12:52 am

    That’s because that’s how sessions work. Just to keep it clean and make sure it’s all good, I’d recommend something more like:

    session_unset();
    session_destroy();
    session_start();
    header('Location: login.php');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My page contain lots of anchor and i have to put that html in
I have a page with HTML anchor tags that have the title attribute set.
I have a HTML anchor that when clicked should make a div slide up
I have an anchor that doesn't go anywhere but has an onclick (e.g. <a
I have an anchor tag on my page that toggles between active and cancelled
I have a MVC app and using JQuery. I have anchor that I setup
I have an anchor element that looks like this <a href=url><img src=imgurl/>Text</a> I would
I have a table row that needs to be hidden when the anchor with
I have an onclick function that I want to add an anchor to the
I have a tooltip on an anchor element, that sends an AJAX request on

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.