ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 28th, 2003, 11:41 PM
baolong baolong is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 17 baolong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Set expire time 2 munites for cookie?

hi all,
how can i set my cookie expire after 2 minutes?

Response.Cookies("KensSurvey").Expires=???

please help!
Thanks.

Reply With Quote
  #2  
Old September 29th, 2003, 02:33 AM
kkong's Avatar
kkong kkong is offline
Monkey Magic
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: UK
Posts: 103 kkong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to kkong
Hi,

The .Expires attibute will only take a date format. If the date is set to the current day then the cookie will expire when the session ends.

I suppose you could also use session.timeout and set that to two minutes.. As long as there were no other session variables you wanted to keep.

Kong.

Reply With Quote
  #3  
Old September 29th, 2003, 02:42 AM
benthekiller benthekiller is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 133 benthekiller User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
hi, im new so i may be no help, but you could use the setcookie function, if you say the time to be time()+120, i think the +120 will make it expire 2 mins rom wen its set.

setcookie("cookie_name", "stuff to be set to the cookie", time()+120, "/", "www.domain.com")

replace cookie_name with the name of the cookie, and where i put "stuff to be set to the cookie", put the data/a php variable like $stuff, now where the slash is, put the folders you want the cookie to be available to, and replace www.domain.com with your domain, its normaly good to take the www out, as that makes it compatible with more browsers or summit, prolly easier for u to read this: http://uk2.php.net/manual/en/function.setcookie.php

edit: sorry! wrong forum...

Last edited by benthekiller : October 1st, 2003 at 09:40 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Set expire time 2 munites 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 5 hosted by Hostway