Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - cookies!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

cookies!

 Post Reply Post Reply
Author
frufru View Drop Down
Newbie
Newbie


Joined: 23 February 2006
Location: Canada
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote frufru Quote  Post ReplyReply Direct Link To This Post Topic: cookies!
    Posted: 19 August 2006 at 7:05pm
I'm working on my self-serve image randomizer system, and it is very well available for use: http://random.mrfrufru.com , and I just can't figure out how to make a cookie not expire until you click logout. There's people saying they don't get the cookie at all or the cookie disappears when they close their browser. I see that is working well on this forum. I tried looking through the code but I couldn't find it. Suppose I have this:

response.cookies("username")=user
response.cookies("password")=pass
if request.form("minutes")<>"-1" then
response.cookies("password").Expires = DateAdd("n", request.form("minutes"), Now())
else
response.cookies("password").Expires = DateAdd("yyyy", 2, Now())
end if


The login form has a drop-down named "minutes" and it gives the number of minutes the user selected to stay logged in, and -1 if they selected forever. So what do I need to do to make it work?
Back to Top
site master View Drop Down
Newbie
Newbie


Joined: 08 January 2006
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote site master Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2006 at 3:52pm
try this:

response.cookies("username")=user
response.cookies("password")=pass
if request.form("minutes")<>"" then
response.cookies("password").Expires = DateAdd("n", request.form("minutes"), Now())
else
response.cookies("password").Expires = DateAdd("yyyy", 2, Now())
end if



Edited by site master - 20 August 2006 at 4:01pm
Back to Top
frufru View Drop Down
Newbie
Newbie


Joined: 23 February 2006
Location: Canada
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote frufru Quote  Post ReplyReply Direct Link To This Post Posted: 21 August 2006 at 2:24pm
meh. nevermind. I got it working. I had to set the Expires property for both the username and password :P
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.