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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:59:28+00:00 2026-06-05T05:59:28+00:00

When a user logs in, a session id is generated accordingly. There is a

  • 0

When a user logs in, a session id is generated accordingly. There is a ‘logout’ link on the page. On clicking the link a jquery ajax method is called to execute a php file which just unsets the session id variable.

If any user uses Firebug or any such tool to see the called-in file address, then s/he can just put the file address in the address bar and the press the ‘Enter’ key to execute the php file which will consequently log the user out which I do not want to happen.

How to prevent the user from doing that? Http_referrer or any such thing?

Scripting language is php.

  • 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-05T05:59:29+00:00Added an answer on June 5, 2026 at 5:59 am

    You could have the AJAX call POST a variable to the PHP page, which the PHP page checks bofore logging the user out.

    If it is a matter of making sure they redirect to the home page after logging out, make the a link to the logout page, then use PHP to send header("Location: home.php");. This has the added bonus of still working even if JavaScript is disabled.

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

Sidebar

Related Questions

On session timeout we re-direct to the login page and if the user logs
When a user logs in to my website, i create a session called $_SESSION['session_city_id']
When a user logs in based on default Forms Authentication method, the server creates
I am creating a session when a user logs in like so: $_SESSION['id'] =
(I think) I understand why session IDs should be rotated when the user logs
When a user logs in on our website, I want to change the session
My web application sets session every time a user logs in. I checked that
I would like to execute the below line when the user logs in so
How do you detect when a user logs out using the ASP.Net 4 session
I have a login page which the user logs in with a username and

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.