Jump to content
MakeWebGames

A little snipet (Could be security could be more)


Haunted Dawg

Recommended Posts

Ok i just worked on this little script. It actualy reminded me of this script because isomerizer & ferdi made one similar they just added a little captcha test so the user does not cheat or something.

Mine is in a 10 set delay. You can take away from it or add more to it.

The only reason why im giving it away is because it is small and it is not finished.

This little script will be on my new game with a 1 second delay. So if the page is reset during 1 second the user will need to do a little math quiz to make sure it is the user and not a bot.

This can be good if you want to implement it on a gym script so no autotraining and such.

Anyway's here it is. Add it to your header.php

 

$_SESSION['page_time'] = time();
echo 'Page Time: '.$_SESSION['page_time'].'
Page Viewed: '.$_SESSION['page_visited'].'

Current Time: '.time().'
Current Page: '.$_SERVER['REQUEST_URI'].'

';
if($_SESSION['page_visited'] == $_SERVER['REQUEST_URI']) //Continue to check if time
{
if(time() > ($_SESSION['page_time'] + 10) OR time() < ($_SESSION['page_time'] + 10))
{
	echo 'The last time you visited this page was 10 second\'s ago.';
}
}
$_SESSION['page_visited'] = $_SERVER['REQUEST_URI'];

 

Please post under this topic if you have made any type of edit's or this could be usefull. DON'T TRY AND RESELL as a security addon as this is totaly not security. But in a way it can become security.

Link to comment
Share on other sites

Re: A little snipet (Could be security could be more)

I know for a fact "duping" could be stoped by using simple sql. But this is more intended to stop constant page refreshing for example the gym or such.

This infact can stop duping for some people.

2 Computer's will never run alike. There fore one will be slower than the other meaning one script will error out while the other won't.

Duping is more done via the tab's. Open 2 tab's go to the same file. And just go right click then refresh all tab's. With that being done. And this script it could stop that with tab's. But then again the user can use http://domain.com and http://www.domain.com. That's only if they are clever enough.

Anyway's i hope some one will find this rather usefull and post us with something usefull.

Link to comment
Share on other sites

Re: A little snipet (Could be security could be more)

With your little test script luke. I get the same thing every page load.

First Try:

Session set

$_SESSION['z'] is a

String length is 1

Second is the same and third is the same. so i do not see why it should show the red font.

Please explan more of what your script should be doing.

Link to comment
Share on other sites

Re: A little snipet (Could be security could be more)

lol there is a way to stop people from having two sessions....

try it on a Horizons Game Engine based gamed. You'll find out that every time you load a page on one browser/computer with a different session ID as another browser/computer, your other browser/computer is auto logged out.

it'd be nearly impossible to do a dual page load on Horizons just because of that, at least using the multiple browser or multiple computer trick. multiple tabs though would work (naturally we account for that)

So, it's pointless to go on and on about this script stopping dual page loads.

I'm sure the script does what it's supposed to do, and that's great. Good job killah.

 

Just a little hint, I'm checking for multiple sessions with the same $_SESSION['userid']

Yes that does involve running a count(*) where userid = blah on every page load to the database sessions table, but eh, the HGE header is highly optimized so adding that one query doesn't impact performance...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...