Partial preview of the text
Download cookies_with_php_json_and_error_handling and more Study notes Web Application Development in PDF only on Docsity!
COOKIE \Tkisa texthte stored in cent browser = ee Memory =only 4x8 a Any Number eb cookies can be + 15+ pasty cookies : Trustable Created based on the boowsers 3 314 party cookies > User briendly pages but can be easily hacked CDrawback) | Fit) |_reaucst aoe Mee ase Le respons) | «Stores the data in the boowser itsclt along with cookies * Captures the user activities a em, * Counts the number ob Himes a browser bi 's @pened a Creaking a cookie with PHP : Setcookiet ) * setcookie(name , value sexpite , path domain )Secrres httpenly )- . mandatory eld (spinal, browser will automatically tntey < 2php default valuis) qname =“sheela” 5 Aval = uu, [output can be seen in an 5 : rc Tnspect->Application Setcookic@ dname , dval}timeyn44)5 a> P Pp 7 Cookies] time C)+ 60 i expiry must be foreach (4-CooKIE as $name vals bme) +60 x60 entered interms echo ¢name, oh Seconds only echo 4valu; > eho 4$_WwoKte > out 7 wl y 4 [$name] outpdt the valus eh cookie Howsput the aa ; echo Svyal, Mowrtput the value divecy Deleting cpokies : There 1s no particulat tunctin to dilete a Cookie A cookie will be auntomabicolly deleted bared om the quer expo time . \W we wanb to access the values ob the cookies ; $name =" Sheela’ ; Avalue = “Aru 5 Setcookie name , §value , time) + 60); 4 $_-CoorlE [gnome 4 (Used 40 access tle value) Tnpormation across dikberent web pote (Te i also. o. tucthile Sore — Tb begins om Nur session: Also it eveabes a new sessim ID for the set. Function : Session_stast0); (Before HIME 0)