General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old March 15th, 2003, 01:27 AM
trinh trinh is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 7 trinh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Can't set the expiry for cookie

Hi everybody !

Could you tell me whats wrong in the following code:

Quote:
setcookie("cookie", "lien", time()+3600, "/","",0);


It didnt work (server didnt sent the cookie to browser), but I wonder why its OK if I replace the above code with
Quote:
setcookie("cookie", "lien", 3600, "/","",0);

whats the meaning of "3600" ? is it 3600 seconds or minutes or what ?

Whats the code if I'd like to set a cookie which expire after 1 houre from current time ?

Help me please ! Im using PHP 4.0.1p12

Reply With Quote
  #2  
Old March 16th, 2003, 05:36 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
To set a cookie use this code.

PHP Code:
 setcookie("name"$valuetime() + 3600"/""www.yoursite.com"1); 


for the time, you must use the time() function otherwise it is not a correct time stamp.

The last 3 parameters are not required.

check out URL for more information

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Can't set the expiry for cookie


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway