Professional Documents
Culture Documents
Unit-4 (Cookies) PART-1
Unit-4 (Cookies) PART-1
CoOktes
CookE
A
A COokte i gnall ok~ct ok inonmakion
Coisting o a hame and tetual value
A Cookie
ondettd
Ltuware Stem y some
on he8euve, Such as CGI CCommon
Gareuway
Intoyace) nogam 2vY http.
Synta
42Php
setcookte C"message ". "No uosvrles. "Ji
4lhead
body7
<hi7 Settfng a Cookte <lhi>
the cowkte uas Set
to 10
Go to a he= "phpgetcooki.php* >phpgctcookie.php </47
<body7 <)html7
Output
phpsetcookle. php
Setfng a Cooklfe
The cocke wab
set. Go to
Se. phpktcookie.php to tead,
Readng a CooKie
Example P10ram
4html
head7 tite7 Readtng a okte <lttte7 <lhead7
pody
<hl> keading a Cookie lhi7
l body7
4/html7
CLLtput
Phpgetceokle. php
Reading a Cookde
The Cookfe sayi No oudes.
fanetion
nta
Cuient
the Cookta should be deleted
To qeb the
can
Number seconds shce Januany,1970 4ou
4Ihead
4body7 t 7
Gyo to
a = phpgetcooke.php'7 Phpqetecokfe-php <a neab.
4lbod7
htmd7
DUutput
.
@FhPseteapotfon- php
setting a Cookte 's ezpiiation tfme
The cookte has been set to eplre in 30das.
Go to phpgetcooele.php neat.
Deletina Cookies
cooRe to
You can sek the ezpnafon ttme a
and that should
Some tfme h the past
brodsen delute the Cookie,
theoaetically makes the
to an
Set the tert the cookle
stêrg ";
empaty
Example
htrnl7
cookies <1tite7
<head tttez Deleting
9php
set coote C "message tme -3boo)
4Iheod7
body
<lhi>
hi7 Peletfng Cookte
Ka et -
"phpgetcookle php* > php getcooke php </laz
2 body7
Output:
Phpdeletecoote.php
Delete cookles
Coolce was deleted,. chuck that at
PMpgetcookfe. php.