473,402 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Cookies from ASP.NET app not persisting even when enabled!

Dear All,

I'm new to ASP.NET and have been developing a small app at work to test
Forms Authentication. When running on my development machine (using
http://localhost/TestApp/Login.aspx for example) everything works fine -
that is, a successful (authenticated) login grants access to other app pages
and the authorization cookie is saved as expected on the local machine.

Unfortunately everything turns ugly when trying to 'test' the app from
another machine on the LAN (now using http://<dev machine
name>/TestApp/Login.aspx rather than 'localhost'). The user enters their
credentials as usual and hits 'login' (and this is where it gets
interesting...), the app correctly authenticates the given user details
(I've added suitable response.write's to show this) but FAILS to authorize
the user and promptly redirects them back to the login page.

Now having spent a 'good few' hours trying to figure this out, it seems that
for whatever reason, any browser OTHER THAN the one on the development
machine FAILS TO PERSIST the authorization cookie (or any other cookie
created by the app for that matter) even though cookies are clearly enabled
on these browsers! I've witnessed that cookies from 'external' web sites are
persisting okay and are subject to IE's cookie settings but those cookies
from my app are simply not working. I've even used an HTTP 'inspection tool'
to view the app's server responses and can clearly see the 'Set-Cookie'
sections in the header!

So in short I believe that authorization is failing because the app cannot
'identify' the client due to the client failing to provide valid
authorization details given to it after a successful login.

Here's some info about my setup that may help a diagnosis!:

Dev machine is XP Pro running ASP.NET 1.1 and IIS 5.1.
IDE is VS.NET 2003.
Remote test machies are W2K, XP Pro and NT4 all with IE6.

As far as I know all machines have latest service packs/patches. ANY help
would be much appreciated as this is driving me crazy.

Thanks in advance,

Lee Wilkie.
Nov 18 '05 #1
2 2424
if you site only works form a local browser, then your site is probably
requiring security access it doesn't have thru impersonation.

as a quick test, go to iis and change your site authentication to basic. if
it now works from other browsers, you need to work out how your site will
get the security access it needs to run. google for lots of answers on
impersonation.

-- bruce (sqlwork.com)


"Lee Wilkie" <le*********@hotmail.com> wrote in message
news:#q**************@TK2MSFTNGP12.phx.gbl...
Dear All,

I'm new to ASP.NET and have been developing a small app at work to test
Forms Authentication. When running on my development machine (using
http://localhost/TestApp/Login.aspx for example) everything works fine -
that is, a successful (authenticated) login grants access to other app pages and the authorization cookie is saved as expected on the local machine.

Unfortunately everything turns ugly when trying to 'test' the app from
another machine on the LAN (now using http://<dev machine
name>/TestApp/Login.aspx rather than 'localhost'). The user enters their
credentials as usual and hits 'login' (and this is where it gets
interesting...), the app correctly authenticates the given user details
(I've added suitable response.write's to show this) but FAILS to authorize
the user and promptly redirects them back to the login page.

Now having spent a 'good few' hours trying to figure this out, it seems that for whatever reason, any browser OTHER THAN the one on the development
machine FAILS TO PERSIST the authorization cookie (or any other cookie
created by the app for that matter) even though cookies are clearly enabled on these browsers! I've witnessed that cookies from 'external' web sites are persisting okay and are subject to IE's cookie settings but those cookies
from my app are simply not working. I've even used an HTTP 'inspection tool' to view the app's server responses and can clearly see the 'Set-Cookie'
sections in the header!

So in short I believe that authorization is failing because the app cannot
'identify' the client due to the client failing to provide valid
authorization details given to it after a successful login.

Here's some info about my setup that may help a diagnosis!:

Dev machine is XP Pro running ASP.NET 1.1 and IIS 5.1.
IDE is VS.NET 2003.
Remote test machies are W2K, XP Pro and NT4 all with IE6.

As far as I know all machines have latest service packs/patches. ANY help
would be much appreciated as this is driving me crazy.

Thanks in advance,

Lee Wilkie.

Nov 18 '05 #2
Hi Bruce,

Thanks for the quick reply. Your suggestion didn't work unfortunately but I
have since found the problem. It was all down to the use of 'illegal' DNS
characters in the dev machine name (an underscore in this case). I used the
IP address instead and everything was fine!

Thanks again,

Lee

"bruce barker" <no***********@safeco.com> wrote in message
news:er**************@TK2MSFTNGP09.phx.gbl...
if you site only works form a local browser, then your site is probably
requiring security access it doesn't have thru impersonation.

as a quick test, go to iis and change your site authentication to basic. if it now works from other browsers, you need to work out how your site will
get the security access it needs to run. google for lots of answers on
impersonation.

-- bruce (sqlwork.com)


"Lee Wilkie" <le*********@hotmail.com> wrote in message
news:#q**************@TK2MSFTNGP12.phx.gbl...
Dear All,

I'm new to ASP.NET and have been developing a small app at work to test
Forms Authentication. When running on my development machine (using
http://localhost/TestApp/Login.aspx for example) everything works fine -
that is, a successful (authenticated) login grants access to other app

pages
and the authorization cookie is saved as expected on the local machine.

Unfortunately everything turns ugly when trying to 'test' the app from
another machine on the LAN (now using http://<dev machine
name>/TestApp/Login.aspx rather than 'localhost'). The user enters their
credentials as usual and hits 'login' (and this is where it gets
interesting...), the app correctly authenticates the given user details
(I've added suitable response.write's to show this) but FAILS to authorize the user and promptly redirects them back to the login page.

Now having spent a 'good few' hours trying to figure this out, it seems

that
for whatever reason, any browser OTHER THAN the one on the development
machine FAILS TO PERSIST the authorization cookie (or any other cookie
created by the app for that matter) even though cookies are clearly

enabled
on these browsers! I've witnessed that cookies from 'external' web sites

are
persisting okay and are subject to IE's cookie settings but those cookies from my app are simply not working. I've even used an HTTP 'inspection

tool'
to view the app's server responses and can clearly see the 'Set-Cookie'
sections in the header!

So in short I believe that authorization is failing because the app cannot 'identify' the client due to the client failing to provide valid
authorization details given to it after a successful login.

Here's some info about my setup that may help a diagnosis!:

Dev machine is XP Pro running ASP.NET 1.1 and IIS 5.1.
IDE is VS.NET 2003.
Remote test machies are W2K, XP Pro and NT4 all with IE6.

As far as I know all machines have latest service packs/patches. ANY help would be much appreciated as this is driving me crazy.

Thanks in advance,

Lee Wilkie.


Nov 18 '05 #3

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

Similar topics

2
by: | last post by:
Its strange...I have experimenting with browser hawk by using the cookie sniffer method. However, even If adjust the security slider level in internet options or goto advanced in the privacy tab I...
9
by: | last post by:
Is it possible for a user to enable permanent cookies but disable session cookies.....this seems like a contradition yet this is what I appear to be reading in online articles?
0
by: bb | last post by:
Hello In my Session_OnStart in Global.asa, I am setting some cookies. One of them, I set as follows: dim UserID UserID = Request.ServerVariables("LOGON_USER") Response.Cookies("User")("ID")...
3
by: Marcin Gorzynski | last post by:
Hi Our partner is using our page in a frame. That couses a problem because our domain is unable to issue the cookie also session does not work. each time you click in the frame new session is...
9
by: Agoston Bejo | last post by:
Hi, I searched around everywhere on the net, but could not find a simple example of detecting if cookies are enabled - on server side, and without moving from one page to another. This should be...
0
by: dawson | last post by:
I started off by trying to use the HttpCapabilitiesBase.Cookies Property (Note: This property is new in the .NET Framework version 2.0) however it kept on returning true even when I disabled...
5
by: jheines | last post by:
I am trying to explain how cookies and sessions work in a class I teach, but I have hit a wall when it comes to the interaction between cookies and the state of the privacy settings in Internet...
3
by: damezumari | last post by:
To find out were session variables are stored I included this instruction in my program: echo ini_get("session.save_path"); The reply was /home/7604/data/tmp which is a folder on my server. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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,...
0
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...

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.