473,795 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cookie Expires In 2.0 Framework

Hello,

I have a problem, I have been using Cookie Authentication on the 1.1
framework for around 3 months, when I moved the site internally within my
hosting company from a server with 1.1 framework to a server with 2.0
framework I have had cookie expiring problems.

Since moving to the 2.0 server, the cookies now expire within 24 hours at
the most. I have checked that the cookie has a expiry date in the future,
which it does (6 years in the future). However it still breaks.

The server is 2003 with IIS 6. I have spoken to their server admins in
length and they believe the servers are setup pretty much the same.

Any advice would be gratefully received.

Regards Adam

Jun 1 '06 #1
7 2045
Adam,

Have you used a tracer/interceptor on the client to see what is being
returned from the server? I would look there first, to see if anything is
being returned differently. If not, it might not be the cookies themselves,
but rather, the code that is processing them that was changed on the move
from 1.1 to 2.0.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Adam Bates" <Adam Ba***@discussio ns.microsoft.co m> wrote in message
news:45******** *************** ***********@mic rosoft.com...
Hello,

I have a problem, I have been using Cookie Authentication on the 1.1
framework for around 3 months, when I moved the site internally within my
hosting company from a server with 1.1 framework to a server with 2.0
framework I have had cookie expiring problems.

Since moving to the 2.0 server, the cookies now expire within 24 hours at
the most. I have checked that the cookie has a expiry date in the future,
which it does (6 years in the future). However it still breaks.

The server is 2003 with IIS 6. I have spoken to their server admins in
length and they believe the servers are setup pretty much the same.

Any advice would be gratefully received.

Regards Adam

Jun 1 '06 #2
Adam,
For Forms Authentication, cookie settings have been changed in asp.net 2.0,
and now persistent cookies take their lifetime from the timeout value in the
<forms> node in the web.config.
That's probably why the change in expiration.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Adam Bates" wrote:
Hello,

I have a problem, I have been using Cookie Authentication on the 1.1
framework for around 3 months, when I moved the site internally within my
hosting company from a server with 1.1 framework to a server with 2.0
framework I have had cookie expiring problems.

Since moving to the 2.0 server, the cookies now expire within 24 hours at
the most. I have checked that the cookie has a expiry date in the future,
which it does (6 years in the future). However it still breaks.

The server is 2003 with IIS 6. I have spoken to their server admins in
length and they believe the servers are setup pretty much the same.

Any advice would be gratefully received.

Regards Adam

Jun 1 '06 #3
Many thanks for the replies. I have used an application to test the cookie.
The cookie has an expiry date which is in the future. So I can guessing the
cookie is being created correctly.

In the web.config I have the following
<forms name="tamworthf cfans" timeout="500000 00" slidingExpirati on="true" />

Thanks again

Adam

"Peter Bromberg [C# MVP]" wrote:
Adam,
For Forms Authentication, cookie settings have been changed in asp.net 2.0,
and now persistent cookies take their lifetime from the timeout value in the
<forms> node in the web.config.
That's probably why the change in expiration.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Adam Bates" wrote:
Hello,

I have a problem, I have been using Cookie Authentication on the 1.1
framework for around 3 months, when I moved the site internally within my
hosting company from a server with 1.1 framework to a server with 2.0
framework I have had cookie expiring problems.

Since moving to the 2.0 server, the cookies now expire within 24 hours at
the most. I have checked that the cookie has a expiry date in the future,
which it does (6 years in the future). However it still breaks.

The server is 2003 with IIS 6. I have spoken to their server admins in
length and they believe the servers are setup pretty much the same.

Any advice would be gratefully received.

Regards Adam

Jun 1 '06 #4
Isn't there a cookiePath attribute? Try putting that in, set to = "/".
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Adam Bates" wrote:
Many thanks for the replies. I have used an application to test the cookie.
The cookie has an expiry date which is in the future. So I can guessing the
cookie is being created correctly.

In the web.config I have the following
<forms name="tamworthf cfans" timeout="500000 00" slidingExpirati on="true" />

Thanks again

Adam

"Peter Bromberg [C# MVP]" wrote:
Adam,
For Forms Authentication, cookie settings have been changed in asp.net 2.0,
and now persistent cookies take their lifetime from the timeout value in the
<forms> node in the web.config.
That's probably why the change in expiration.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Adam Bates" wrote:
Hello,

I have a problem, I have been using Cookie Authentication on the 1.1
framework for around 3 months, when I moved the site internally within my
hosting company from a server with 1.1 framework to a server with 2.0
framework I have had cookie expiring problems.

Since moving to the 2.0 server, the cookies now expire within 24 hours at
the most. I have checked that the cookie has a expiry date in the future,
which it does (6 years in the future). However it still breaks.

The server is 2003 with IIS 6. I have spoken to their server admins in
length and they believe the servers are setup pretty much the same.

Any advice would be gratefully received.

Regards Adam

Jun 1 '06 #5
Many thanks for your response. I tried the solution with teh following error.
Any other suggestions?

Parser Error Message: Unrecognized attribute 'cookiePath'. Note that
attribute names are case-sensitive

Line 31: <authenticati on mode="Forms">
Line 32: <forms name="tamworthf cfans" cookiePath="/" timeout="500000 00"
slidingExpirati on="true" />
Line 33: </authentication>

"Peter Bromberg [C# MVP]" wrote:
Isn't there a cookiePath attribute? Try putting that in, set to = "/".
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Adam Bates" wrote:
Many thanks for the replies. I have used an application to test the cookie.
The cookie has an expiry date which is in the future. So I can guessing the
cookie is being created correctly.

In the web.config I have the following
<forms name="tamworthf cfans" timeout="500000 00" slidingExpirati on="true" />

Thanks again

Adam

"Peter Bromberg [C# MVP]" wrote:
Adam,
For Forms Authentication, cookie settings have been changed in asp.net 2.0,
and now persistent cookies take their lifetime from the timeout value in the
<forms> node in the web.config.
That's probably why the change in expiration.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Adam Bates" wrote:

> Hello,
>
> I have a problem, I have been using Cookie Authentication on the 1.1
> framework for around 3 months, when I moved the site internally within my
> hosting company from a server with 1.1 framework to a server with 2.0
> framework I have had cookie expiring problems.
>
> Since moving to the 2.0 server, the cookies now expire within 24 hours at
> the most. I have checked that the cookie has a expiry date in the future,
> which it does (6 years in the future). However it still breaks.
>
> The server is 2003 with IIS 6. I have spoken to their server admins in
> length and they believe the servers are setup pretty much the same.
>
> Any advice would be gratefully received.
>
> Regards Adam
>

Jun 3 '06 #6
Turns out that it is "path", not "cookiePath ". All in the documentation if
you care to read it:

http://msdn2.microsoft.com/en-us/library/1d3t3c61.aspx
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Adam Bates" wrote:
Many thanks for your response. I tried the solution with teh following error.
Any other suggestions?

Parser Error Message: Unrecognized attribute 'cookiePath'. Note that
attribute names are case-sensitive

Line 31: <authenticati on mode="Forms">
Line 32: <forms name="tamworthf cfans" cookiePath="/" timeout="500000 00"
slidingExpirati on="true" />
Line 33: </authentication>

"Peter Bromberg [C# MVP]" wrote:
Isn't there a cookiePath attribute? Try putting that in, set to = "/".
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Adam Bates" wrote:
Many thanks for the replies. I have used an application to test the cookie.
The cookie has an expiry date which is in the future. So I can guessing the
cookie is being created correctly.

In the web.config I have the following
<forms name="tamworthf cfans" timeout="500000 00" slidingExpirati on="true" />

Thanks again

Adam

"Peter Bromberg [C# MVP]" wrote:

> Adam,
> For Forms Authentication, cookie settings have been changed in asp.net 2.0,
> and now persistent cookies take their lifetime from the timeout value in the
> <forms> node in the web.config.
> That's probably why the change in expiration.
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "Adam Bates" wrote:
>
> > Hello,
> >
> > I have a problem, I have been using Cookie Authentication on the 1.1
> > framework for around 3 months, when I moved the site internally within my
> > hosting company from a server with 1.1 framework to a server with 2.0
> > framework I have had cookie expiring problems.
> >
> > Since moving to the 2.0 server, the cookies now expire within 24 hours at
> > the most. I have checked that the cookie has a expiry date in the future,
> > which it does (6 years in the future). However it still breaks.
> >
> > The server is 2003 with IIS 6. I have spoken to their server admins in
> > length and they believe the servers are setup pretty much the same.
> >
> > Any advice would be gratefully received.
> >
> > Regards Adam
> >

Jun 3 '06 #7
Many thanks for your suggestion. After testing, I can saddly confirm that it
doesn't work :-(

Any other suggestions?

"Peter Bromberg [C# MVP]" wrote:
Turns out that it is "path", not "cookiePath ". All in the documentation if
you care to read it:

http://msdn2.microsoft.com/en-us/library/1d3t3c61.aspx
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Adam Bates" wrote:
Many thanks for your response. I tried the solution with teh following error.
Any other suggestions?

Parser Error Message: Unrecognized attribute 'cookiePath'. Note that
attribute names are case-sensitive

Line 31: <authenticati on mode="Forms">
Line 32: <forms name="tamworthf cfans" cookiePath="/" timeout="500000 00"
slidingExpirati on="true" />
Line 33: </authentication>

"Peter Bromberg [C# MVP]" wrote:
Isn't there a cookiePath attribute? Try putting that in, set to = "/".
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Adam Bates" wrote:

> Many thanks for the replies. I have used an application to test the cookie.
> The cookie has an expiry date which is in the future. So I can guessing the
> cookie is being created correctly.
>
> In the web.config I have the following
> <forms name="tamworthf cfans" timeout="500000 00" slidingExpirati on="true" />
>
> Thanks again
>
> Adam
>
> "Peter Bromberg [C# MVP]" wrote:
>
> > Adam,
> > For Forms Authentication, cookie settings have been changed in asp.net 2.0,
> > and now persistent cookies take their lifetime from the timeout value in the
> > <forms> node in the web.config.
> > That's probably why the change in expiration.
> > Peter
> >
> > --
> > Co-founder, Eggheadcafe.com developer portal:
> > http://www.eggheadcafe.com
> > UnBlog:
> > http://petesbloggerama.blogspot.com
> >
> >
> >
> >
> > "Adam Bates" wrote:
> >
> > > Hello,
> > >
> > > I have a problem, I have been using Cookie Authentication on the 1.1
> > > framework for around 3 months, when I moved the site internally within my
> > > hosting company from a server with 1.1 framework to a server with 2.0
> > > framework I have had cookie expiring problems.
> > >
> > > Since moving to the 2.0 server, the cookies now expire within 24 hours at
> > > the most. I have checked that the cookie has a expiry date in the future,
> > > which it does (6 years in the future). However it still breaks.
> > >
> > > The server is 2003 with IIS 6. I have spoken to their server admins in
> > > length and they believe the servers are setup pretty much the same.
> > >
> > > Any advice would be gratefully received.
> > >
> > > Regards Adam
> > >

Jun 6 '06 #8

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

Similar topics

5
3495
by: AHN | last post by:
Please tell me somebody what causes the cookie set with <% Response.Cookies("blah") = "Blah blah" Response.Cookies("blah").Expires = DateAdd( "h", 1, Now() ) %> work as supposed on my local server but fail on my site on Brinkster. On the next page it disappears if used with "Expires" attribute set, and is there, if without. It was working some time ago. I was forced to reinstall my OS (W2k, IIS 5.0) since then and already a few days I...
4
5297
by: Shannon Jacobs | last post by:
I'm doing some trivial surveys, and I want to know if the same user answers twice. Can't really know that, but at least I thought I could check for the same browser/computer combination by using a cookie. Here is the code I have now. In the header, I have the following: <SCRIPT language="JavaScript"> var cookieStatus; if (document.cookie.length > 0) { cookieStatus = 'Cookie exists with value ' + document.cookie; } else {
12
18018
by: chrism | last post by:
Hello, I have a pop-up window that I would like to appear in front of the browser home page when a user opens IE. Problem is, I'd like it to never appear again if the user navigates back to the home page during their time using the browser. However, if the user closes the browser, then reopens, the pop-up should appear again. (you may have guessed that this will be used for public access pc's.) I want to try as best I can to catch...
5
3315
by: brettr | last post by:
When I reference document.cookie, there is a long string of key=value; pairs listed. I may have 100 hundred cookies on my hard drive. However, most only have one key=value pair. Does the document.cookie variable combine all cookie key=value pairs? All of the examples I've seen discuss referencing a specific cookie. I don't see how this is done. Cookies are usually named by the domain. If I want to reference a specific cookie, do I...
1
2225
by: Mike | last post by:
Hello, I can't find any javascript that reads and writes cookies with keys, so that it is compatible with ASP (I want to read and write cookies from both javascript and ASP) for example in ASP: <% Response.Cookies("user")("firstname")="John" Response.Cookies("user")("lastname")="Smith"
6
7083
by: Jason Collins | last post by:
There seems to be an inconsistency (bug?) in the way the Set-Cookie header is handled by the WebHeaderCollection. That is, the values of Set-Cookie, when an Expires is specified, contain the "," character. This seems to be incorrectly parsed during GetValues(). A simple example shows it best (there are 2 .aspx pages and an output): AddHeaders.aspx: <%@ Page language="c#" %>
15
3652
by: Oleg Leikin | last post by:
Hi, (newbie question) I've created some simple .NET ASP application that should store cookies at the client machine. According to the documentation cookie expiration time is set via HttpCookie.Expires property, but property value is the time of day on the client. How can I possibly know client local time ?
1
2016
by: Henri | last post by:
Hi, My page saves user's login on user's computer using a cookie: Dim expires As Date = DateTime.Now.AddMonths(1) Dim cookie As New HttpCookie("login", loginValue) cookie.Expires = expires Response.Cookies.Add(cookie) On the same page, user can click on a button to remove this cookie by
1
6719
by: CR1 | last post by:
I found a great cookie script below, but don't know how to make it also pass the values sent to the cookie, to a querystring as well for tracking purposes. Can anyone help? If there was a way to simply pass the values in a cookie to the querystring that would be even easier, but from what I've been able to tell, cookie values can't be passed to a querystring. I'm sure the answer will help alot of others who are using this script, and would...
0
1826
by: JT | last post by:
I posted a question earlier about communicating between a javascript function and vb.net. In the end I decided to try using a cookie. I use the following javascript function (from vb.net) to set the cookie: sb.Append("<script language='javascript'>") sb.Append("{if (confirm('Are you sure? ') == true)") sb.Append("{var date = new Date(); date.setTime(date.getTime()+(60*60*1000)); var expires = ' expires='+date.toGMTString();...
0
9522
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
10448
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
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...
0
10003
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...
1
7544
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6784
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
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...
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2922
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.