Re: Cookies and Lifetime
| From: | Dennis Gearon | Date: | Fri, 06 Oct 2000 17:05:36 +0000 |
| Subject: | Re: Cookies and Lifetime | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-18945@lists.php.net to get a copy of this message | ||
Or you could set two cookies. One with zero which is always valid, and
one with additional key that says,"If I don't have a brother around (the
other one has expiered), I am no good"
> ie/ if 20 minutes is up then expire the cookie but if you exit the
browser
> before 20 minutes then the cookie will also expire. To my understanding,
If
> you set the cookie to expire in 20 minutes and exit the browser, then
come
> back to the site in 1 minute the cookie is still valid and avilable.
this is
> not what I want!!
There isn't a way to do what you want it to do AFAIK. The cookies use a
UNIX
timestamp (seconds since 1970) and there isn't a way to do both AFAIK.
You
might be able to code around it.
Set a cookie that expires when the browser exits. Then have your 20
minute
timed cookie. Do a check - if the exit set cookie is not there and the
20
minute one is then you know they closed their browser and are now trying
to
come back. If both are there they are good to go. If the 20 minute one
is
gone and the exit set cookie isn't then you know their session has
expired.
I see what you are trying to do now - the above is something I thought
of
off
the top of my head - hope it helps!
--Joe
>
> Thanks everybody,
>
> scott.
>
>
> "Joe Stump" <joe@earth.care2.com> wrote in message
> news:20001005174105.B10332@zorka.com...
> > On Thu, Oct 05, 2000 at 07:32:24PM -0500, Dean Hall wrote:
> > > RTM. (I'm polite.)
> >
> > One of the few ;o) (thanks).
> >
> > AFAIK (As Far As I Know) you just omit the expire time and it
> automagically
> > expires when the browser closes - but check the manual like Dean said.
> >
> > --Joe
> >
> >
> > >
> > > http://www.php.net/manual
> > >
> > > Dean.
> > > ----- Original Message -----
> > > From: "scott" <scott@redbluedesign.com.au>
> > > To: <php-general@lists.php.net>
> > > Sent: Thursday, October 05, 2000 6:39 PM
> > > Subject: [PHP] Cookies and Lifetime
> > >
> > >
> > > > I know how to set the cookie so it will expire on browser exit (by
not
> > > > setting anytime), but how do you set the cookie so it will expire
on
> > > broswer
> > > > exit and expire after 10 of inactivity??
> > > >
> > > > Thanks
> > > >
> > > > scott.
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > > For additional commands, e-mail: php-general-help@lists.php.net
> > > > To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-general-help@lists.php.net
> > > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
> > /*****************************\
> > * Joe Stump *
> > * www.Care2.com *
> > * Office: 650.328.0198 *
> > * Extension: 122 *
> > \*****************************/
> > http://www.miester.org/Joe/Stump/Joe_Stump_resume.html
> >
> > -----BEGIN GEEK CODE BLOCK-----
> > Version: 3.12
> > GB/E/IT d- s++:++ a? C++++ UL++$ P+ L+++$ E----! W+++$
> > N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
> > 5? R-! tv@ b+ DI++@ D(++++) G++@ e+@ h@ r+! z(+++++**)!
> > ------END GEEK CODE BLOCK------
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
/*****************************\
* Joe Stump *
* www.Care2.com *
* Office: 650.328.0198 *
* Extension: 122 *
\*****************************/
http://www.miester.org/Joe/Stump/Joe_Stump_resume.html
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GB/E/IT d- s++:++ a? C++++ UL++$ P+ L+++$ E----! W+++$
N+@ o? K? w---! O-@ M+@ V-! P(++) PE(+) Y+@ PGP+++@ t+@
5? R-! tv@ b+ DI++@ D(++++) G++@ e+@ h@ r+! z(+++++**)!
------END GEEK CODE BLOCK------
--
-----------------------------------------------------------------
Time Spent With Your Dog(Kid) is Time Well Spent
-----------------------------------------------------------------
Sincerely, Dennis Gearon