Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@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 -
Stocken4296yThis is why PHP got a bad reputation, its so much bull code out there, and no guidelines to follow (e.g.W3 or Mozilla).
-
Seriously, I see no need for that code to exist.
I just don't see the purpose. Mind enlightening me? -
@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 -
@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 -
@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
Related Rants
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];
}
rant
wtf
security
session
cookie
bug