Jump to content

[SOLVED] sessions and security, theory question


Lodius2000

Recommended Posts

so i know a little about sessions but heres my question

 

if my page logic goes

session_start();

if ($_SESSION['user']){

display page

}

 

what is to stop someone from going to www.blah.com/index.php where that page contains

session_start();

$_SESSION['user'] = "blah";

 

and then redirecting their browser to my page. would that give them access to my sensitive pages?

if no why not and if yes what can i do to make my page more secure?

 

thanks

The session values are based on the server, not the browser.

 

Try it, go register at some other site, and once the session values are set at that site (blah.com) go to your page and see if the session values carry over. They won't. Same thing goes for trying to use 2 seperate windows, it just wouldn't work.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.