Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cookie expiration in the life of the browser
Message
De
14/06/2006 11:48:26
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
14/06/2006 11:34:44
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01129035
Message ID:
01129054
Vues:
12
>It seems that the value of Expires should not be set. This is really confusing. I thought by passing an empty date that this was doing the same thing. As when using WWC, we simply send a blank to that value which was achieving the same thing. So, basically, I do it like this:
>
>
>        ' Add a cookie
>        ' expC1 Cookie
>        ' expC2 Value
>        ' expC3 Path
>        ' expC4 Expiration
>        Public Function AddCookie(ByVal tcCookie As String, ByVal tcValue As String, _
>         ByVal tcPath As String, ByVal tdExpiration As Date) As Boolean
>            Dim lcPath As String = tcPath
>            Dim lcValue As String = tcValue
>            Dim loCookie As New System.Web.HttpCookie(tcCookie)
>
>            ' If empty we take the default path
>            If lcPath.Length = 0 Then
>                lcPath = "/"
>            End If
>
>            ' This will determine if there is a need to encrypt the cookie
>            ' Everything is based on oApp.lEncryption
>            lcValue = oApp.EncryptUrl(lcValue, False)
>
>            loCookie.Value = lcValue
>
>            ' If the expiration date is empty, we should not pass it in order for the cookie to expire
>            ' when the browser session ends
>            If Not oApp.EmptyDate(tdExpiration) Then
>                loCookie.Expires = tdExpiration
>            End If
>
>            loCookie.Path = tcPath
>            oApp.oCookie.Add(loCookie)
>        End Function
>
>
>If someone has some more information to share on the topic, don't hesitate to let me know.

(read your reply)
Found this in documentation:
"Setting the Expires property to MinValue makes this a session Cookie, which is its default value."
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform