Jump to content

Recommended Posts

Hi everyone!

Great to be back - haven't visited for quite some time - and I return with a question!

To log out of my script, you send "lo=t" to a page. However, the website I am making allows user-customisable scripts, and so anyone feeling particularly vandalous might make a "fake" link that logs the visiting user out. How can I verify that the link was from the correct area?

I have the feeling I could make use of the SID but I don't know how!

Thanks

Sam
Link to comment
https://forums.phpfreaks.com/topic/13786-verifying-internal-link/
Share on other sites

Ok

Well to log out, you click on a link that brings you to "[b]index.php?lo=t[/b]"

The website has areas where users can have their own customised HTML

Somone could easily put a link like this "[b]<a href="index.php?lo=t">Click here to go to my webpage</a>[/b]", but this link would instead log the viewer out.

How can I verify that the "Log Out" button is being pressed only from where I want it to be pressed?
echo "<a href='index.php?lo=t&sess_id=" . $PHPSESSID."'>Logout</a>";

then check to see if sess_id exists and if so check to see if it matches up with the session id

this of course assumes that your allowing of custom html does not include allowing them to insert their own php as well...
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.