473,569 Members | 3,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2434
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*********@ho tmail.com> wrote in message
news:#q******** ******@TK2MSFTN GP12.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******** ******@TK2MSFTN GP09.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*********@ho tmail.com> wrote in message
news:#q******** ******@TK2MSFTN GP12.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
1928
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 cannot seem to prove the condition below....it is almost as if cookies don't want to die in my testing environment. I did try closing the browser...
9
2525
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
2702
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") = UCASE(UserID) When I immediately log the cookie value retrieved from
3
2092
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 created. Is there any way that cookie can be issed , some way to go arround frames restrictions. Thanks for your help. Marcin Gorzynski...
9
7846
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 a very basic functionality, so I am reluctant to believe that there's no way to simply test it in a server-side script. Anyone? Thx, Agoston
0
541
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 cookies in both FireFox and Internet Explorer. After a bit of googling I found that a lot of people were creating cookies, then re-reading them;...
5
5555
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 Explorer. I would appreciate any help anyone can offer, please. First, consider the following very simple JavaScript function: function...
3
4910
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 look at /home/7604/data/tmp and it is full of session files for today. Even so, if I have cookies blocked for my site http://easyquestion.net
0
7930
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. ...
0
8138
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...
0
7983
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...
0
6290
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...
0
5228
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...
0
3662
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...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
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...

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.