php - Use json string in a URL (authentication) -


im trying setup script puls json string 1 adress, , use string in adress, have not found way using php , curl.

so first go

mysite.com/data.json?req=login&username=user&password=pass ,

receives string like: "sessionid":"12345678",

then use sessionid in next url this:

mysite.com//data.json?req=sendmessage=hello&sessionid=12345678 

thank solutions regarding issue!

i never send username , password this security issue. use post method instead.

mysite.com/data.json?req=login&username=user&password=pass 

when json data parse , save sessionid somewhere session or cookie or using define function if ok. whenever need make url use saved 1 below. have used session.

<a href="mysite.com/data.json?req=sendmessage=hello&sessionid=<?php echo $_session['sessionid'] ?>">link</a> 

but after doing above not secure. making room act using url parameter sessionid. if trying use web go using plane sessions normal. recommend read article once gain knowledge on how sessions more important. , here link post passing sessionid parameter discussed. hope helps.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -