cookies_with_php_json_and_error_handling, Study notes of Web Application Development

How cookies work and how to create, retrieve, and delete them using PHP. It also covers the use of the filter_var function to validate and filter data. code examples and explanations of the different functions and constants used. useful for students learning PHP and web development.

Typology: Study notes

2022/2023

Available from 10/04/2023

praseeda-kallakuri
praseeda-kallakuri 🇮🇳

4 documents

1 / 28

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c

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)