Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: cookie expire


Message #1 by "John Sen Yong" <yjohns@t...> on Wed, 23 May 2001 14:49:14 +0800
hi..when user log in, its username and password will put into a cookie

so that i can retrive the user info...



the problem is that how can i make the cookie expire if the user just close

the browser and forget to logout.

The other users cant retrieve its info when used the same computer later.

if the user has clicked logout, will the cookie will automically expired?

if can what shall i write?

please help....







Message #2 by "Ian Richardson" <ian@i...> on Wed, 23 May 2001 08:08:36 +0100
John,

AFAIK, if you do not set an expiration date on your cookie, it will expire

as soon as the browser session ends. So it acts as a psuedo Session VAriable

but stored on the client, not the server. I am not 100% sure about this so I

would be interesed to hear if anyone can confirm this.



hth

ianmetaxa



-----Original Message-----

From: John Sen Yong [mailto:yjohns@t...]

Sent: 23 May 2001 07:49

To: ASP Databases

Subject: [asp_databases] cookie expire





hi..when user log in, its username and password will put into a cookie

so that i can retrive the user info...



the problem is that how can i make the cookie expire if the user just close

the browser and forget to logout.

The other users cant retrieve its info when used the same computer later.

if the user has clicked logout, will the cookie will automically expired?

if can what shall i write?

please help....





Message #3 by "John Stallings" <jstallings@i...> on Wed, 23 May 2001 06:19:12 -0700
Here is an excerpt from the MSDN library on setting cookies:

Parameters



  cookie

  The name of the cookie.

  key

  An optional parameter. If key is specified, cookie is a dictionary, and

key is set to value.

  attribute

  Specifies information about the cookie itself. The attribute parameter can

be one of the following. Name Description

        Domain Write-only. If specified, the cookie is sent only to requests

to this domain.

        Expires Write-only. The date on which the cookie expires. This date

must be set in order for the cookie to be stored on the client's disk after

the session ends. If this attribute is not set to a date beyond the current

date, the cookie will expire when the session ends.

        HasKeys Read-only. Specifies whether the cookie contains keys.

        Path  Write-only. If specified, the cookie is sent only to requests

to this path. If this attribute is not set, the application path is used.

        Secure Write-only. Specifies whether the cookie is secure.



  Value

  Specifies the value to assign to key or attribute.

----- Original Message -----

From: "Ian Richardson" <ian@i...>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, May 23, 2001 12:08 AM

Subject: [asp_databases] RE: cookie expire





> John,

> AFAIK, if you do not set an expiration date on your cookie, it will expire

> as soon as the browser session ends. So it acts as a psuedo Session

VAriable

> but stored on the client, not the server. I am not 100% sure about this so

I

> would be interesed to hear if anyone can confirm this.

>

> hth

> ianmetaxa

>

> -----Original Message-----

> From: John Sen Yong [mailto:yjohns@t...]

> Sent: 23 May 2001 07:49

> To: ASP Databases

> Subject: [asp_databases] cookie expire

>

>

> hi..when user log in, its username and password will put into a cookie

> so that i can retrive the user info...

>

> the problem is that how can i make the cookie expire if the user just

close

> the browser and forget to logout.

> The other users cant retrieve its info when used the same computer later.

> if the user has clicked logout, will the cookie will automically expired?

> if can what shall i write?

> please help....

>

Message #4 by "Charles Feduke" <webmaster@r...> on Wed, 23 May 2001 21:44:22 -0400
> the problem is that how can i make the cookie expire if the user just close

> the browser and forget to logout.



    What you want is called a session cookie.  These persist only in the browser

process(es) until the browser is closed and are never written to disk.  To use a

session cookie, simply do not set an expiry (expiration date) on the cookie.  If

there is a cookie already written to disk, see what setting the "Expires"

property to -1 gets you.



- Chuck



----- Original Message -----

From: "John Sen Yong" <yjohns@t...>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, May 23, 2001 2:49 AM

Subject: [asp_databases] cookie expire





> hi..when user log in, its username and password will put into a cookie

> so that i can retrive the user info...

>

> the problem is that how can i make the cookie expire if the user just close

> the browser and forget to logout.

> The other users cant retrieve its info when used the same computer later.

> if the user has clicked logout, will the cookie will automically expired?

> if can what shall i write?

> please help....

>

>
Message #5 by "Ian Richardson" <ian@i...> on Thu, 24 May 2001 08:33:12 +0100
don't set the cookie.expires value and the cookie will not write to the

client browser when the browser closes down.



ianmetaxa



-----Original Message-----

From: Charles Feduke [mailto:webmaster@r...]

Sent: 24 May 2001 02:44

To: ASP Databases

Subject: [asp_databases] Re: cookie expire





> the problem is that how can i make the cookie expire if the user just

close

> the browser and forget to logout.



    What you want is called a session cookie.  These persist only in the

browser

process(es) until the browser is closed and are never written to disk.  To

use a

session cookie, simply do not set an expiry (expiration date) on the cookie.

If

there is a cookie already written to disk, see what setting the "Expires"

property to -1 gets you.



- Chuck



----- Original Message -----

From: "John Sen Yong" <yjohns@t...>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, May 23, 2001 2:49 AM

Subject: [asp_databases] cookie expire





> hi..when user log in, its username and password will put into a cookie

> so that i can retrive the user info...

>

> the problem is that how can i make the cookie expire if the user just

close

> the browser and forget to logout.

> The other users cant retrieve its info when used the same computer later.

> if the user has clicked logout, will the cookie will automically expired?

> if can what shall i write?

> please help....

>

>


  Return to Index