Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Most secure way to pass variables between two pages with PHP

I need a way to pass a variable between two page in a secure way.

I know that I can use POST / GET / Cookie / Session or hidden fields but I think none of these ways aren't secure enough because :

get can be seen in the url
cookies is a client side so it can be change from client
session can confront Session ID hijacking and ...

Now I want to know is there another ways better than these ways and if there isn't witch of these is the best way to pass variables in secure manner;

like image 288
Kibo Avatar asked Oct 30 '12 15:10

Kibo


1 Answers

Session is the most secure method you have available.

Session id regeneration will help against session hijacking, but SSL via https will really protect against it.

BTW: If the session is hijacked and you're displaying user data to the client, it doesn't matter how you got the data to the second page, the hijacker will see it. If you're only using it server side, the hijacker won't see it.

like image 68
Ray Avatar answered Nov 14 '22 22:11

Ray