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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:56:10+00:00 2026-05-17T14:56:10+00:00

I read about session security eg. Session Fixation, Hijacking & Injection but am confused

  • 0

I read about session security eg. Session Fixation, Hijacking & Injection but am confused about the workings of session security. The way I usually do it:

// when user logins, 
$_SESSION["user"] = "someuser";

// check user login
if (isset($_SESSION["user"]) && !empty($_SESSION["user"]))

Maybe I am doing it wrong, but I don’t have Session IDs anywhere, or at least I didn’t use it. Can someone explain how should Session IDs be used & how it affects session security? Also, is my understanding of the following threats correct?

Session Fixation

  • User visits link (http://site.com?session_id=123) and logs in
  • Server “marks” that session id as logged in
  • Hacker can now visit http://site.com?session_id=123

My understanding of Session Fixation seems very wrong to me. If its correct won’t it mean that hackers can randomly use session ids and I will likely be used by an existing user?

Session Hijacking

  • Hacker somehow gets Session ID whether by Fixation or guessing etc

Session Injection

  • What is this?
  • 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-17T14:56:11+00:00Added an answer on May 17, 2026 at 2:56 pm

    You’re not using session IDs explicitly, but PHP uses them automatically. The session ID is sent as a cookie to the browser, who sends it back to the server with every request to identify itself and resume the session. Without that, sessions are not possible.

    A way to improve security is to regularly change the ID of a session, using session_regenerate_id(). That way, if a hacker acquires somebody’s session ID, he has only a limited amount of time to abuse it.

    Another way to prevent session hijacking (a hacker using your session ID to steal your session) is to store the client IP and user agent string when the session is opened and verifying that they haven’t changed when resuming the session.

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

Sidebar

Related Questions

I read about Session Hijacking articles and would like to some more information related
I have read ALOT of information about session security, and have come up with
I've just read on the net about a newly discovered security vulnerability in ASP.NET.
I read about the Conditional attribute today. According to MSDN: Applying ConditionalAttribute to a
I read about using the CASE expression inside the WHERE clause here: http://scottelkin.com/sql/using-a-case-statement-in-a-sql-where-clause/ I'm
I have read about partial methods in the latest C# language specification , so
From what I've read about Windsor/Microkernel it is in theory possible to do everything
I've read about and dabbled with some including active record, repository, data transfer objects.
I like to read about new and clever algorithms. And I like to think
Everything I read about better PHP coding practices keeps saying don't use require_once because

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.