IT Community - Software Programming, Web Development and Technical Support

How to Retrieve a Cookie Value?

This is a discussion on How to Retrieve a Cookie Value? within the PHP Programming forums, part of the Web Development category; Hi, Any one Explain Retrieve the cookie value....


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 02-11-2008, 02:03 AM
sundarraja sundarraja is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 174
sundarraja is on a distinguished road
Question How to Retrieve a Cookie Value?

Hi,


Any one Explain Retrieve the cookie value.
__________________
R.Sundar Raja
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 02-11-2008, 02:07 AM
sundarraja sundarraja is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 174
sundarraja is on a distinguished road
Thumbs up Re: How to Retrieve a Cookie Value?

The PHP $_COOKIE variable is used to retrieve a cookie value.


In the example below, we retrieve the value of the cookie named "user" and display it on a page:

<?php
// Print a cookie
echo $_COOKIE["user"];
// A way to view all cookies
print_r($_COOKIE);
?>
__________________
R.Sundar Raja
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 02-26-2008, 09:19 PM
Jeyaseelansarc Jeyaseelansarc is offline
D-Web Genius
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,165
Jeyaseelansarc is on a distinguished road
Send a message via AIM to Jeyaseelansarc
Default Re: How to Retrieve a Cookie Value?

Hi,
Do u have any idea to delete the client cookie in PHP?
__________________
With,
J. Jeyaseelan

Everything Possible
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 03-29-2008, 02:48 AM
Kamalakannan Kamalakannan is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 299
Kamalakannan is on a distinguished road
Default Re: How to Retrieve a Cookie Value?

When deleting a cookie you should assure that the expiration date is in the past, to trigger the removal mechanism in your browser.

Examples:
PHP Code:
<?php
// set the expiration date to one hour ago
setcookie ("TestCookie"""time() - 3600);
setcookie ("TestCookie"""time() - 3600"/~rasmus/"".example.com"1);
?>
__________________
Thanks & Regards,
R.Kamalakannan.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 04-02-2008, 06:00 AM
sureshbabu sureshbabu is offline
D-Web Programmer
 
Join Date: Jul 2007
Location: India
Posts: 99
sureshbabu is on a distinguished road
Send a message via AIM to sureshbabu Send a message via MSN to sureshbabu Send a message via Yahoo to sureshbabu Send a message via Skype™ to sureshbabu
Default Re: How to Retrieve a Cookie Value?

cookie mainly used in which part?
__________________
Thanks
Regards
Sureshbabu Harikrishnan
+91 9884320017
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieve only the Nth row from a table? santhakumar Database Support 6 11-14-2008 04:12 AM
All About Cookie dharmendra2000 Software Testing 0 05-31-2008 01:32 AM
Retrieve mails from server kingmaker C# Programming 6 12-14-2007 10:42 PM
How do I retrieve the values from the URL? Pvinothkumar HTML, CSS and Javascript Coding Techniques 1 09-13-2007 05:30 AM
which method to use so that last inserted value can be retrieve. KiruthikaSambandam Database Support 1 08-06-2007 11:13 PM


All times are GMT -7. The time now is 02:12 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0