Hi,

I want to use cookies instead of session variables for better performance on
a website. But I would like to expire cookie as soon as the user closes the
browser window. Just like session variable, cookie should expire after
browser window is closed. Can someone tell me if this possible. If it is how
should I do it.

Thanks for your time.

Joe

Re: Question about cookies. by Roland

Roland
Sat Jul 23 23:25:03 CDT 2005

"Joe" wrote in message
news:C2DA98A8-DFFC-4977-8148-6BD34913EABF@microsoft.com...
: I want to use cookies instead of session variables for better performance
on
: a website.

Better performance?

: But I would like to expire cookie as soon as the user closes the
: browser window.

Sorry Charlie. The browser would have to update the server that it was
leaving and that just doesn't happen.

: Just like session variable,

Sessions do not expire when the client closes the browser. The expire when
they're explicitly told to expire or they time out. The default is 20
minutes.

: cookie should expire after
: browser window is closed.

It will, based on the termination date/time.

: Can someone tell me if this possible.

Never seen it done.

: If it is how
: should I do it.

Prayer perhaps. (O:=

: Thanks for your time.

No problem.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp



Re: Question about cookies. by Joe

Joe
Thu Aug 04 17:14:01 CDT 2005

Hey Roland, Have a look at this article,
http://www.thescripts.com/serversidescripting/asp/articles/page1.html . This
guy says that if you don't set the Expires property then the cookie is
destroyed when the user closes his/her browser. I have done that and it does
destroy the cookie.

Sorry man but you need to update you knowledge about cookies.

Joe


"Roland Hall" wrote:

> "Joe" wrote in message
> news:C2DA98A8-DFFC-4977-8148-6BD34913EABF@microsoft.com...
> : I want to use cookies instead of session variables for better performance
> on
> : a website.
>
> Better performance?
>
> : But I would like to expire cookie as soon as the user closes the
> : browser window.
>
> Sorry Charlie. The browser would have to update the server that it was
> leaving and that just doesn't happen.
>
> : Just like session variable,
>
> Sessions do not expire when the client closes the browser. The expire when
> they're explicitly told to expire or they time out. The default is 20
> minutes.
>
> : cookie should expire after
> : browser window is closed.
>
> It will, based on the termination date/time.
>
> : Can someone tell me if this possible.
>
> Never seen it done.
>
> : If it is how
> : should I do it.
>
> Prayer perhaps. (O:=
>
> : Thanks for your time.
>
> No problem.
>
> --
> Roland Hall
> /* This information is distributed in the hope that it will be useful, but
> without any warranty; without even the implied warranty of merchantability
> or fitness for a particular purpose. */
> Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
> WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
> MSDN Library - http://msdn.microsoft.com/library/default.asp
>
>
>

Re: Question about cookies. by Roland

Roland
Fri Aug 05 14:43:43 CDT 2005

"Joe" wrote in message
news:66BC1EC4-FAA5-4D30-87FF-50C17C44B0EA@microsoft.com...
: Hey Roland, Have a look at this article,
: http://www.thescripts.com/serversidescripting/asp/articles/page1.html .
This
: guy says that if you don't set the Expires property then the cookie is
: destroyed when the user closes his/her browser. I have done that and it
does
: destroy the cookie.
:
: Sorry man but you need to update you knowledge about cookies.

You're correct. I bled cookies and sessions together. Cookies will expire
but sessions will not when the browser is closed. The only problem with
both is if all cookies are disabled, none of it will work.

Another issue with cookies is this: go to a page with a cookie and type
this in at the URL: javascript:alert(document.cookies)

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp