Welcome Guest, Not a member yet? Register   Sign In
How to create/delete Cookies
#1

[eluser]Gowrisankar[/eluser]
hi,
i need a help for create cookies and delete cookies.
Please tell me the step by step procedure in codeigniter.

*For Signout purpose
#2

[eluser]jcavard[/eluser]
step by step:
#1 - Open a new tab in the current browser window.
#2 - Navigate to User_Guide
#3 - Open table of content, and browse the Helper Column to Cookie. (http://ellislab.com/codeigniter/user-gui...elper.html)
#4 - PROFIT???
#3

[eluser]gyo[/eluser]
lol
#4

[eluser]Jhourlad Estrella[/eluser]
Yup, exactly. That works most of the time.
#5

[eluser]InsiteFX[/eluser]
See my post here!

InsiteFX
#6

[eluser]Tiến Thành[/eluser]
[quote author="Gowrisankar" date="1282179542"]hi,
i need a help for create cookies and delete cookies.
Please tell me the step by step procedure in codeigniter.

*For Signout purpose[/quote]

You can create function to set or delete cookie in your project

Code:
public function resetCookie($now){
   //when you set cookie
   if($now){
           $cook = array(
                   'name'=>'test',
                   'value'=>$now,
                   'expire'=>'12345'
             );
   }

//when you delete cookie
   else{
            $cook = array(
                   'name'=>'test',
                   'value'=>'',
                   'expire'=>'0'
             );
       }
  set_cookie($cook);

}


#7

[eluser]InsiteFX[/eluser]
Expire is an integer not a string.




Theme © iAndrew 2016 - Forum software by © MyBB