How to Create Cookie Set Get And Delete Cookie Helper
How to Create Cookie #Set #Get And #Delete in Codeigniter In Hindi English
Before cookie use.
We Have to use Cookie Helper load.
This helper is loaded using the following code
$this->load->helper('cookie');
<html>
<head>
<title>How to Create Cookie Set Get And Delete Cookie Helper</title>
</head>
<body>
<h1>How to create cookie in codeigniter</h1>
<?php
/*
set_cookie(); -> set cookie following code create cookie
get_cookie(); -? get cookie following code get cookie information
delete_cookie(); ->delete cookie code delete cookie
*/
/*
$cookie = array(
'name' => 'Pagalhub', //write cookie name you want (we write pagalhub)
'value' => 'pagalhubcompnany', // write value of cookie (any name, any value, you want)
'expire' => time()+86500, // WRITE HOW MANY TIME COOKIE MONTH ,YEARS,SEC MIN,
'domain' => '', // DOMAIN NAME PROVIDE EX:XYZ.COM OR LOCALHOST
'path' => '/',
'prefix' => 'pagalhub_', //if you used prefix then cookie name like this"pagalhub_Pagalhub"
//
);
$this->input->set_cookie($cookie);*/
//Getting cookie information or display cookie information
echo get_cookie("pagalhub_Pagalhub"); // given value of pagalhub
// delete_cookie('pagalhub_Pagalhub'); //Now Delete Cookie
?>
</body>
</html>
No comments: