473,657 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FormsAuthentica tion cookies timeout

I am trying to get my authentication to work and want the timeout to be 30
minutes, but only while the browser is active. If the browser closes, I
want the cookie to disappear.

Is this possible?

The 2 web configs are set as:

*************** *************** *
<system.web>
<authenticati on mode="Forms">
<forms name="staffing"
loginUrl="/development/staffing/logon.aspx"
protection="All "
path="/" />
</authentication>
</system.web>
*************** *************** ***

*************** *************** *****
<configuratio n>
<system.web>
<authorizatio n>
<deny users="?" />
</authorization>
</system.web>
</configuration>
*************** *************** ********

My problem is during testing the cookie gets turned on and I have to wait
until the timeout stops.

Is there a way I can manully delete the cookie?

Where would it be located when the 'path="/"'?

Thanks,

Tom.
Nov 19 '05 #1
8 1178
I did find that I can find the cookie in Mozilla in preferences.

The problem is the expiration time appears to be: Wednesday, January 13,
2055 4:06:51 PM

2055?????

Default is 30 minutes.

Am I missing something?

Thanks,

Tom.
"tshad" <ts**********@f tsolutions.com> wrote in message
news:uT******** ********@TK2MSF TNGP12.phx.gbl. ..
I am trying to get my authentication to work and want the timeout to be 30
minutes, but only while the browser is active. If the browser closes, I
want the cookie to disappear.

Is this possible?

The 2 web configs are set as:

*************** *************** *
<system.web>
<authenticati on mode="Forms">
<forms name="staffing"
loginUrl="/development/staffing/logon.aspx"
protection="All "
path="/" />
</authentication>
</system.web>
*************** *************** ***

*************** *************** *****
<configuratio n>
<system.web>
<authorizatio n>
<deny users="?" />
</authorization>
</system.web>
</configuration>
*************** *************** ********

My problem is during testing the cookie gets turned on and I have to wait
until the timeout stops.

Is there a way I can manully delete the cookie?

Where would it be located when the 'path="/"'?

Thanks,

Tom.

Nov 19 '05 #2
hi tshad..
in ur web.config the default timeout is 20mins.
<sessionState
mode="InProc"
stateConnection String="tcpip=1 27.0.0.1:42424"
sqlConnectionSt ring="data source=127.0.0. 1;Trusted_Conne ction=yes"
cookieless="fal se"
timeout="20"
/>
Why don't u change it to ur taste..
Hope it helps
Patrick


"tshad" wrote:
I am trying to get my authentication to work and want the timeout to be 30
minutes, but only while the browser is active. If the browser closes, I
want the cookie to disappear.

Is this possible?

The 2 web configs are set as:

*************** *************** *
<system.web>
<authenticati on mode="Forms">
<forms name="staffing"
loginUrl="/development/staffing/logon.aspx"
protection="All "
path="/" />
</authentication>
</system.web>
*************** *************** ***

*************** *************** *****
<configuratio n>
<system.web>
<authorizatio n>
<deny users="?" />
</authorization>
</system.web>
</configuration>
*************** *************** ********

My problem is during testing the cookie gets turned on and I have to wait
until the timeout stops.

Is there a way I can manully delete the cookie?

Where would it be located when the 'path="/"'?

Thanks,

Tom.

Nov 19 '05 #3
"Patrick.O. Ige" <Pa*********@di scussions.micro soft.com> wrote in message
news:6B******** *************** ***********@mic rosoft.com...
hi tshad..
in ur web.config the default timeout is 20mins.
<sessionState
mode="InProc"
stateConnection String="tcpip=1 27.0.0.1:42424"
sqlConnectionSt ring="data
source=127.0.0. 1;Trusted_Conne ction=yes"
cookieless="fal se"
timeout="20"
/>
That is what I am trying to do.

I want to use forms Authentication to control access to my pages and I am
finding that my cookies have an expiration date of 50 years from now (no
matter what I set the timeout field to - maybe this field will not help me).

I would actually like the cookie (or session cookie) for each person to
disapear when they leave the browser. But I also want to make sure that if
the browser is left on for more that some time (say 20 minutes), they have
to log on again.

I was looking on the MS site about cookies and they say that the expiration
date is pointless - it is either there or it isn't. The expiration field is
for information only.

So what good is the timeout?

Tom Why don't u change it to ur taste..
Hope it helps
Patrick


"tshad" wrote:
I am trying to get my authentication to work and want the timeout to be
30
minutes, but only while the browser is active. If the browser closes, I
want the cookie to disappear.

Is this possible?

The 2 web configs are set as:

*************** *************** *
<system.web>
<authenticati on mode="Forms">
<forms name="staffing"
loginUrl="/development/staffing/logon.aspx"
protection="All "
path="/" />
</authentication>
</system.web>
*************** *************** ***

*************** *************** *****
<configuratio n>
<system.web>
<authorizatio n>
<deny users="?" />
</authorization>
</system.web>
</configuration>
*************** *************** ********

My problem is during testing the cookie gets turned on and I have to wait
until the timeout stops.

Is there a way I can manully delete the cookie?

Where would it be located when the 'path="/"'?

Thanks,

Tom.

Nov 19 '05 #4
in ur web.config ..in the forms TAG
whats the name of the Cookie?
In ur code how are u adding the cookie..
Or u didn't specify it at all(but at the same time Forms Auth needs it!!)


"tshad" wrote:
I did find that I can find the cookie in Mozilla in preferences.

The problem is the expiration time appears to be: Wednesday, January 13,
2055 4:06:51 PM

2055?????

Default is 30 minutes.

Am I missing something?

Thanks,

Tom.
"tshad" <ts**********@f tsolutions.com> wrote in message
news:uT******** ********@TK2MSF TNGP12.phx.gbl. ..
I am trying to get my authentication to work and want the timeout to be 30
minutes, but only while the browser is active. If the browser closes, I
want the cookie to disappear.

Is this possible?

The 2 web configs are set as:

*************** *************** *
<system.web>
<authenticati on mode="Forms">
<forms name="staffing"
loginUrl="/development/staffing/logon.aspx"
protection="All "
path="/" />
</authentication>
</system.web>
*************** *************** ***

*************** *************** *****
<configuratio n>
<system.web>
<authorizatio n>
<deny users="?" />
</authorization>
</system.web>
</configuration>
*************** *************** ********

My problem is during testing the cookie gets turned on and I have to wait
until the timeout stops.

Is there a way I can manully delete the cookie?

Where would it be located when the 'path="/"'?

Thanks,

Tom.


Nov 19 '05 #5
"Patrick.O. Ige" <Pa*********@di scussions.micro soft.com> wrote in message
news:A7******** *************** ***********@mic rosoft.com...
in ur web.config ..in the forms TAG
whats the name of the Cookie?
In ur code how are u adding the cookie..
Or u didn't specify it at all(but at the same time Forms Auth needs it!!)
Found it.

The problem was that I was passing true as the 2nd argument in
RedirectFromLog inPage. This says to save the cookie on disk and will
persist for 50 years.

By setting it to false, it doesn't write the cookie.

The timeout parameter is how long it will last while the browser is open.
This apparently gets reset if you go to another page before the timeout
period.

Thanks,

Tom

"tshad" wrote:
I did find that I can find the cookie in Mozilla in preferences.

The problem is the expiration time appears to be: Wednesday, January 13,
2055 4:06:51 PM

2055?????

Default is 30 minutes.

Am I missing something?

Thanks,

Tom.
"tshad" <ts**********@f tsolutions.com> wrote in message
news:uT******** ********@TK2MSF TNGP12.phx.gbl. ..
>I am trying to get my authentication to work and want the timeout to be
>30
>minutes, but only while the browser is active. If the browser closes, I
>want the cookie to disappear.
>
> Is this possible?
>
> The 2 web configs are set as:
>
> *************** *************** *
> <system.web>
> <authenticati on mode="Forms">
> <forms name="staffing"
> loginUrl="/development/staffing/logon.aspx"
> protection="All "
> path="/" />
> </authentication>
> </system.web>
> *************** *************** ***
>
> *************** *************** *****
> <configuratio n>
> <system.web>
> <authorizatio n>
> <deny users="?" />
> </authorization>
> </system.web>
> </configuration>
> *************** *************** ********
>
> My problem is during testing the cookie gets turned on and I have to
> wait
> until the timeout stops.
>
> Is there a way I can manully delete the cookie?
>
> Where would it be located when the 'path="/"'?
>
> Thanks,
>
> Tom.
>


Nov 19 '05 #6
Well Tom..
Nice u got the stuff urself
No worries..
Patrick
**But remember the tiemout in Web.Config overrides the one in IIS**
(Tested it myself)

"tshad" wrote:
"Patrick.O. Ige" <Pa*********@di scussions.micro soft.com> wrote in message
news:A7******** *************** ***********@mic rosoft.com...
in ur web.config ..in the forms TAG
whats the name of the Cookie?
In ur code how are u adding the cookie..
Or u didn't specify it at all(but at the same time Forms Auth needs it!!)


Found it.

The problem was that I was passing true as the 2nd argument in
RedirectFromLog inPage. This says to save the cookie on disk and will
persist for 50 years.

By setting it to false, it doesn't write the cookie.

The timeout parameter is how long it will last while the browser is open.
This apparently gets reset if you go to another page before the timeout
period.

Thanks,

Tom


"tshad" wrote:
I did find that I can find the cookie in Mozilla in preferences.

The problem is the expiration time appears to be: Wednesday, January 13,
2055 4:06:51 PM

2055?????

Default is 30 minutes.

Am I missing something?

Thanks,

Tom.
"tshad" <ts**********@f tsolutions.com> wrote in message
news:uT******** ********@TK2MSF TNGP12.phx.gbl. ..
>I am trying to get my authentication to work and want the timeout to be
>30
>minutes, but only while the browser is active. If the browser closes, I
>want the cookie to disappear.
>
> Is this possible?
>
> The 2 web configs are set as:
>
> *************** *************** *
> <system.web>
> <authenticati on mode="Forms">
> <forms name="staffing"
> loginUrl="/development/staffing/logon.aspx"
> protection="All "
> path="/" />
> </authentication>
> </system.web>
> *************** *************** ***
>
> *************** *************** *****
> <configuratio n>
> <system.web>
> <authorizatio n>
> <deny users="?" />
> </authorization>
> </system.web>
> </configuration>
> *************** *************** ********
>
> My problem is during testing the cookie gets turned on and I have to
> wait
> until the timeout stops.
>
> Is there a way I can manully delete the cookie?
>
> Where would it be located when the 'path="/"'?
>
> Thanks,
>
> Tom.
>


Nov 19 '05 #7
"Patrick.O. Ige" <Pa*********@di scussions.micro soft.com> wrote in message
news:C2******** *************** ***********@mic rosoft.com...
Well Tom..
Nice u got the stuff urself
No worries..
Patrick
**But remember the tiemout in Web.Config overrides the one in IIS**
(Tested it myself)
Yes, it is great to find it myself as I will probably remember it better.
But sometimes you just can't find it.

Is the IIS one, the 20 minutes you mentioned?

Thanks,

Tom
"tshad" wrote:
"Patrick.O. Ige" <Pa*********@di scussions.micro soft.com> wrote in message
news:A7******** *************** ***********@mic rosoft.com...
> in ur web.config ..in the forms TAG
> whats the name of the Cookie?
> In ur code how are u adding the cookie..
> Or u didn't specify it at all(but at the same time Forms Auth needs
> it!!)


Found it.

The problem was that I was passing true as the 2nd argument in
RedirectFromLog inPage. This says to save the cookie on disk and will
persist for 50 years.

By setting it to false, it doesn't write the cookie.

The timeout parameter is how long it will last while the browser is open.
This apparently gets reset if you go to another page before the timeout
period.

Thanks,

Tom
>
>
>
>
>
>
> "tshad" wrote:
>
>> I did find that I can find the cookie in Mozilla in preferences.
>>
>> The problem is the expiration time appears to be: Wednesday, January
>> 13,
>> 2055 4:06:51 PM
>>
>> 2055?????
>>
>> Default is 30 minutes.
>>
>> Am I missing something?
>>
>> Thanks,
>>
>> Tom.
>> "tshad" <ts**********@f tsolutions.com> wrote in message
>> news:uT******** ********@TK2MSF TNGP12.phx.gbl. ..
>> >I am trying to get my authentication to work and want the timeout to
>> >be
>> >30
>> >minutes, but only while the browser is active. If the browser
>> >closes, I
>> >want the cookie to disappear.
>> >
>> > Is this possible?
>> >
>> > The 2 web configs are set as:
>> >
>> > *************** *************** *
>> > <system.web>
>> > <authenticati on mode="Forms">
>> > <forms name="staffing"
>> > loginUrl="/development/staffing/logon.aspx"
>> > protection="All "
>> > path="/" />
>> > </authentication>
>> > </system.web>
>> > *************** *************** ***
>> >
>> > *************** *************** *****
>> > <configuratio n>
>> > <system.web>
>> > <authorizatio n>
>> > <deny users="?" />
>> > </authorization>
>> > </system.web>
>> > </configuration>
>> > *************** *************** ********
>> >
>> > My problem is during testing the cookie gets turned on and I have to
>> > wait
>> > until the timeout stops.
>> >
>> > Is there a way I can manully delete the cookie?
>> >
>> > Where would it be located when the 'path="/"'?
>> >
>> > Thanks,
>> >
>> > Tom.
>> >
>>
>>
>>


Nov 19 '05 #8
Yeah the Timeouts in Web.config overrides.
Patrick

"tshad" wrote:
"Patrick.O. Ige" <Pa*********@di scussions.micro soft.com> wrote in message
news:C2******** *************** ***********@mic rosoft.com...
Well Tom..
Nice u got the stuff urself
No worries..
Patrick
**But remember the tiemout in Web.Config overrides the one in IIS**
(Tested it myself)


Yes, it is great to find it myself as I will probably remember it better.
But sometimes you just can't find it.

Is the IIS one, the 20 minutes you mentioned?

Thanks,

Tom

"tshad" wrote:
"Patrick.O. Ige" <Pa*********@di scussions.micro soft.com> wrote in message
news:A7******** *************** ***********@mic rosoft.com...
> in ur web.config ..in the forms TAG
> whats the name of the Cookie?
> In ur code how are u adding the cookie..
> Or u didn't specify it at all(but at the same time Forms Auth needs
> it!!)

Found it.

The problem was that I was passing true as the 2nd argument in
RedirectFromLog inPage. This says to save the cookie on disk and will
persist for 50 years.

By setting it to false, it doesn't write the cookie.

The timeout parameter is how long it will last while the browser is open.
This apparently gets reset if you go to another page before the timeout
period.

Thanks,

Tom
>
>
>
>
>
>
> "tshad" wrote:
>
>> I did find that I can find the cookie in Mozilla in preferences.
>>
>> The problem is the expiration time appears to be: Wednesday, January
>> 13,
>> 2055 4:06:51 PM
>>
>> 2055?????
>>
>> Default is 30 minutes.
>>
>> Am I missing something?
>>
>> Thanks,
>>
>> Tom.
>> "tshad" <ts**********@f tsolutions.com> wrote in message
>> news:uT******** ********@TK2MSF TNGP12.phx.gbl. ..
>> >I am trying to get my authentication to work and want the timeout to
>> >be
>> >30
>> >minutes, but only while the browser is active. If the browser
>> >closes, I
>> >want the cookie to disappear.
>> >
>> > Is this possible?
>> >
>> > The 2 web configs are set as:
>> >
>> > *************** *************** *
>> > <system.web>
>> > <authenticati on mode="Forms">
>> > <forms name="staffing"
>> > loginUrl="/development/staffing/logon.aspx"
>> > protection="All "
>> > path="/" />
>> > </authentication>
>> > </system.web>
>> > *************** *************** ***
>> >
>> > *************** *************** *****
>> > <configuratio n>
>> > <system.web>
>> > <authorizatio n>
>> > <deny users="?" />
>> > </authorization>
>> > </system.web>
>> > </configuration>
>> > *************** *************** ********
>> >
>> > My problem is during testing the cookie gets turned on and I have to
>> > wait
>> > until the timeout stops.
>> >
>> > Is there a way I can manully delete the cookie?
>> >
>> > Where would it be located when the 'path="/"'?
>> >
>> > Thanks,
>> >
>> > Tom.
>> >
>>
>>
>>


Nov 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1542
by: G-Fit | last post by:
Hello group, I use Forms Authentication in my web application and I am not sure I understand the way the cookie works. I use the SetAuthCookie method with a database identifier as userName, as I would like the website to remember who is logged in (and I guess it doesn't matter wether I store a name or an identifier, which is much more convenient for me) :
0
1584
by: benny | last post by:
Hi, I used following procedure to created the cookies:- FormsAuthentication.RedirectFromLoginPage(IntToStr(BizCustomerID), wchkRememberLogin.Checked); I found that the setting on web.config :- <authentication mode="Forms"> <forms loginUrl="CustLogin.aspx" protection="All" name="Customer" path="/" timeout="60" />
1
2266
by: Tommy | last post by:
I want to encrypt the values of my cookies. I found out that I could create a FormsAuthenticationTicket, and use the FormsAuthentication.Encrypt method to encrypt the cookie. However, I do not want to use FormsAuthentication feature. I already have custom code to redirect the use back to the login page if they haven't signed on. My question is can I use the FormsAuthentication.Encrypt method to encrypt my cookies without using the...
1
2232
by: Danny | last post by:
Hi there, I was wondering if anyone would be able to shed some light on the following behaviour for me. I have an application that is using Forms Authentication with non-persistent cookies, a forms timeout of 10 minutes, and a FormsAuthenticationTicket Expiration of 10 minutes. Almost everything is working as expected... when users try to enter restricted parts of the site they are redirected to the login.aspx page that I have...
2
1811
by: Grant Merwitz | last post by:
Hi, i am using forms authentication in an ASP.NET project I am setting the Forms authentication cookie by using: FormsAuthentication.RedirectFromLoginPage(UserName.Text, false); Now when i review my trace on my page, there are two cookies created that look identical. When i FormsAuthentication.SignOut() they both dissappear. Any ideas as to why two cookies are created?
4
8322
by: Matthias S. | last post by:
Hi there, I've created an application which is using Forms-based authentification. My Login-Button event handler looks somewhat like this: // validate the input, etc... // sUserName holds now the users name FormsAuthenticationTicket ticket = new FormsAuthenticationTicket( 1, sUserName, DateTime.Now, DateTime.Now.AddMinutes(20),false,
0
841
by: Rof | last post by:
I am using FormsAuthentication.RedirectFromLoginPage(...) to give my users a cookie, but I want to include other bits in the cookie, like their name, what they are asking for, and so on. I have this in Login.aspx: System.Web.Security.FormsAuthentication.RedirectFromLoginPage("Peter", True) Response.Cookies("Peter").Expires = Now.AddSeconds(60) Response.Cookies("Peter")("whoami") = "Anon"
2
2700
by: rn5a | last post by:
A web.config file has the following code: <configuration> <system.web> <authentication mode="Forms"> <forms name="NETConnectCookie" loginUrl="Login.aspx"> <credentials passwordFormat="SHA1"/> </forms> </authentication> </system.web>
0
2879
by: Rodrigo m. Ferreira | last post by:
Can you help me to solve the following problem? on my loggin page I have the code: protected void LoginButton_Click(object sender, EventArgs e) { if(Membership.ValidateUser(TXTUsuario.Text, TXTSenha.Text)) {
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8516
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.