31 replies · 2,907 views · started 15 years ago · 1 min read
TL;DR · summary of 31 replies
- The code snippet provided is meant to check if the user agent has been tampered with, and if so, it should log them out.
- It was suggested that this function be placed before or after session_start(), but there was confusion about whether session variables are required for its operation.
- The discussion concluded that the code snippet provided is meant to check for user agent tampering and logs users out if the user agent does not match, which could prevent session hijacking.
- It was also mentioned that adding a salt to the session values can further enhance security.
Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.
So I was right but ori and subzero didn't understand me,
The code is trying to check if the user is trying to inject session values through the get or post superglobals that's.why I thought it should be phpsessid. this hack is only possible with register globals turned on though.
If you want to use it, put it at the very top of every page. Or even better, at the top of a file which you include in all your pages like your settings file.
A discussion on anti session hijacking is sad? ..... hmmm ok what ever you say.
Seeming you have this so called big business or what ever it is you do. You dont really do much to help your self.
If i was going to hire someone to work for me etc i would do a google search for them and see if there is anything good or bad posted about them....
well in this case i would find you b!tching at everything .... then think your a right (place your word here) and think im not hiring you.
But then again its not my life you lead it how you want to, we all make our own choices in life but when there done we have to live with them.
SCRIPTS FOR SALE BY SUBZERO
Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
_______…
function page_protect()
{
session_start();
if (isset($_SESSION['HTTP_USER_AGENT']))
{
if ($_SESSION['HTTP_USER_AGENT'] != md5($_SERVER['HTTP_USER_AGENT']))
{
login();
exit;
}
}
}
function login()
{
session_start();
if(isset($_SESSION['sid']) || isset($_COOKIE['sid'])) {
Enter your sql for your own site !!
}
How to use
Under core or what ever !
page_protect();
Add a thanks here or the button !!
Sir im using ejatd29 sc,so where i must to put this code