3

Why people do that shit ? is a free backdoor to sniff other user content XD

if(isset($_COOKIE["user"])){
resetSession("user","user");
}

function resetSession($cookiename,$sessionname){
$_SESSION[$sessionname] = $_COOKIE[$cookiename];
}

Comments
  • 0
  • 0
    @IntrusionCM look closer :p
    cookie value is copie to session value for user... Im logged as Jack pouff now im Julie XD with my browser
  • 0
    This is why PHP got a bad reputation, its so much bull code out there, and no guidelines to follow (e.g.W3 or Mozilla).
  • 0
    @Stocken sometime juste logic do the work ... Thisbis illogic
  • 1
    Seriously, I see no need for that code to exist.

    I just don't see the purpose. Mind enlightening me?
  • 0
    @jak645 I really have no clue why anyone would do this... Hence the question tag

    @Stocken Your comment makes even less sense to me.... There are tons of recommendations out there regarding PHP, Session Security, ...

    I think there cannot be a guideline.

    Bring's me back to the question: What's the purpose of that code?

    Resetting a Session is something entirely different... And what is stored inside the Cookie?

    I'm really confused as the code seems to me completely bogus
  • 0
    @IntrusionCM i don't know yet what is the the sens of this code ... I comment it and noting change. I wait for the suprise too put up Xx.

    I think the last programmer think is to let the session alive but is automatic in php for each request XD
  • 0
    @jak645 If session autostart is enabled, yes.

    For Session restore you would need the sessionId of the previous Session, Stop and destroy current Session, resume old session.

    And resetting session would mean for me that you'll destroy current session and start a fresh one with No values or default / sane values...

    That's why the code bamboozled me... XD
Add Comment