If you need to decide between $ _SESSION and $ _GET, then for safe stuff use $ _SESSION. Everything that the user can do with the sessions destroys them (by deleting the PHPSESSID cookie), but the user cannot manipulate them.
If you need to pass the information once, $ _SESSION is very good. You can save some data in the $ _SESSION variable, change the location via PHP (so that the user cannot block the script by disabling JavaScript. Just use header('Location: '.$path); ), use the contents of $ _SESSION on another page and the user will not has a time interval when it can destroy a session. It's safe.
arik
source share