Jump to content

Recommended Posts

How hard is it for someone to grab your scripts $_SESSION and $_REQUEST variables?

I wonder not in the interest of hacking but in the interest of preventative scripting. 

I want to start making my code more secure but I have no idea how to do anything malicious or mischievous with php so I don't know how to protect things.

 

Link to comment
https://forums.phpfreaks.com/topic/99225-grabbing-_session-and-_request-variables/
Share on other sites

Sorry for the "grab" terminology.

<?php
$StoredGrab = $_SESSION['SOMETHINGTOGRAB'];
?>

 

These files are stored on the server, ok. Does that mean User2 can access the contents of $_SESSION['SOMETHING'] stored by USER99?

so anyone having read access to those files can "grab" them.

Furthermore, can you have a multi-dimensional array when it comes to $_SESSION ?

For example:

$_SESSION['USERKEY']['CAT1']['DATA1']

$_SESSION['USERKEY']['CAT1']['DATA2']

Sorry for the "grab" terminology.

<?php
$StoredGrab = $_SESSION['SOMETHINGTOGRAB'];
?>

 

These files are stored on the server, ok. Does that mean User2 can access the contents of $_SESSION['SOMETHING'] stored by USER99?

so anyone having read access to those files can "grab" them.

No, users cannot access anything per se, but if they have a matching session ID then PHP will use the information stored for that user on disk.

 

Furthermore, can you have a multi-dimensional array when it comes to $_SESSION ?

For example:

$_SESSION['USERKEY']['CAT1']['DATA1']

$_SESSION['USERKEY']['CAT1']['DATA2']

Yes. That would be no problem.

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.