Jump to content

PHP sessions security... help


dvdriper

Recommended Posts

hi, I'm new to php, ... have a question, :) it's not a complicated one I guess...

 

If I have a website, and on every page there is a condition... something like that:

 

if (isset($_SESSION["nickname"]) and isset($_SESSION["pass"])) {

echo "<html>

... the page....

";

 

} else {

 

echo "access denied!";

exit;

}

 

I wonder, if someone on his computer makes a script like this:

<?php

 

session_start();

 

$_SESSION['nickname'] = "whatever";

$_SESSION['nickname'] = "whatever";

 

?>

 

and after that enteres my site...

the script will deny him?

 

if no, please, what should I make to somehow protect my script....

 

I guess i need on every page to ask the database if there is such a session with "nickname" with such a "pass", yes?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

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.