-13

I have a question about my Stack Overflow post: How do i improve security of User Login

My question related to PHP sessions. Nothing related to SQL injections, But professionals has marked my question as a duplicate sql injection question. But my question is not related to sql injection answer is not helpful at all. Please reopen my question.

2
  • 9
    Jay likes to inform and not just hammer. The reason why he added that first one about SQL injection is your code is wide open to that kind of attack. Read it and learn how to use prepared statements.
    – Machavity Mod
    Commented Jun 17, 2019 at 20:54
  • 10
    Hello! Just in case that part is unclear @web_guy, SQL injection is actually the single biggest security risk in your code. I know that you want to ask about something else, but the only honest answer to "please help me to secure this code" is first to fix the SQL injection, then the rest. Commented Jun 17, 2019 at 21:04

1 Answer 1

16

Your question is marked as a duplicate of two questions:

The second one addresses the immediate problem that you're focused on: trying to maintain two separate sessions with the same root domain. The first addresses... some other issues with the code you posted.

You should read them both and apply the recommendations. If you have further questions after doing this, post a new question and cite what you've already read and applied.

14
  • And this is the reason why I didn't like the "multiple duplicate thing". If the question can be subdivided into two full fledged questions, then the OP didn't focus it enough and it's too broad.
    – Braiam
    Commented Jun 17, 2019 at 19:41
  • 1
    Honestly @Braiam, that's always been an awkward fit for "too broad" - closing a question that asks multiple questions is a tremendous amount of work compared to dropping a few links or just editing out the extra questions. Any time you're substituting something that takes 5 people for something that takes 1, you gotta figure it's just not gonna happen.
    – Shog9
    Commented Jun 17, 2019 at 19:51
  • @Shog9 If we edit out some of the questions, wouldn't that conflict with the intent of the post though? It seems like that's something that the OP needs to do. Commented Jun 17, 2019 at 20:13
  • 3
    If you think their intent was to not get any of their questions answered, then yes, trying to edit it so that at least one of them could be answered would be a gross violation @EJoshuaS. But as with the golden rule, we should probably not assume that others are masochists.
    – Shog9
    Commented Jun 17, 2019 at 20:32
  • How do we know which one the OP wants us to keep, though? Commented Jun 17, 2019 at 20:33
  • 2
    That's easy - presumably they want all of them. So just pick one and tell 'em to re-ask the rest.
    – Shog9
    Commented Jun 17, 2019 at 20:35
  • So for cases of multiple questions, we should just edit (rather than vote to close) now? Commented Jun 17, 2019 at 20:37
  • 1
    I would. Unless all of the questions had already been asked, in which case dup-closing with multiple targets is a perfect match.
    – Shog9
    Commented Jun 17, 2019 at 20:38
  • 1
    @Shog9 Jay likes to make PSAs about SQL injection. That's probably why he had it in there
    – Machavity Mod
    Commented Jun 17, 2019 at 20:54
  • 1
    I can't really complain, given the question was well on its way to being closed as unclear before Jay sussed out what the asker was talking about @Machavity.
    – Shog9
    Commented Jun 17, 2019 at 20:56
  • @Shog9 If you read the bullet points on this answer you will notice that that is the last resort. If SE expanded the gold hammer to the unclear/too broad category, and removed the multiple duplicates thing, you will notice a proportional shift between closed as duplicates and too broad.
    – Braiam
    Commented Jun 17, 2019 at 21:48
  • @Braiam: Here's the thing: the question isn't too broad. It was closed as a dupe of multiple questions, not because it had multiple questions, but because there was a substantial issue in the post which was completely unrelated to the question. Namely, using horrible practices that were open to SQL injection. That's not what he was asked about, but the multiple duplicate feature was used as a way to explain the other issue to him. Commented Jun 18, 2019 at 2:33
  • @Shog9 Should I create a separate question on this so that this can be added as an answer? That way it would have more visibility, and the posts could be voted on. Commented Jun 18, 2019 at 3:10
  • New question here: meta.stackoverflow.com/questions/386186/… Commented Jun 18, 2019 at 17:30

Not the answer you're looking for? Browse other questions tagged .