Jump to content

Grabbing $_SESSION and $_REQUEST Variables


blackcell

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.

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.