473,467 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Authentication Twice?

I am using forms authentication in my project. Within my login page I
check that the user is valid against the database and use the following
code to issue the cookie and redirect them to the next page:

FormsAuthentication.SetAuthCookie(txtUser.Text.Tri m, False)
Response.Redirect("UserAccount.aspx")

My problem is that rather then loading the UserAccount.aspx page, it is
redirecting back to the login page. When a valid user and password is
entered a second time, the useraccount.aspx page loads. Any idea why
this is happening?

Oct 2 '06 #1
2 3072
If you have roles set???
Is it all manual coded auth. stuff?
"ClevelandSteve" <sy******@hotmail.comschreef in bericht
news:11**********************@m7g2000cwm.googlegro ups.com...
>I am using forms authentication in my project. Within my login page I
check that the user is valid against the database and use the following
code to issue the cookie and redirect them to the next page:

FormsAuthentication.SetAuthCookie(txtUser.Text.Tri m, False)
Response.Redirect("UserAccount.aspx")

My problem is that rather then loading the UserAccount.aspx page, it is
redirecting back to the login page. When a valid user and password is
entered a second time, the useraccount.aspx page loads. Any idea why
this is happening?

Oct 3 '06 #2
I figured out what was happening. I was running my page through Visual
Studio, so the URL in Internet Explorer would contain "localhost"
and the cookie was issued for localhost. On the redirect I was using
the IP address of the page and since the cookie was issued under
localhost, the form validation would kick in again. It works fine when
I open Internet Explorer and type in the URL directly.

Thanks for taking a look though.

Oct 4 '06 #3

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

Similar topics

7
by: luigipaioro | last post by:
Good morning to all! I'm trying to access on a web page that needs user and password authentication. I'm enabled to access there (I mean that I have an user name and a password to access via...
7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
3
by: Raghuraman | last post by:
Hi , am new to sqlserver 2000.I want to connect to my sqlserver which is a remote machine.I want to connect to sqlserver by sqlserver authentication.Even though i added the available sqlserver...
1
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
4
by: clintonG | last post by:
When VS.NET creates a web.config file it writes a default <authentication mode="Windows" /> entry. Let me see if I got this right... 1.) It does so because I am running locally and my local...
10
by: Will Gillen | last post by:
I have an ASP.NET application that is using Windows Integrated Authentication (IIS) (as opposed to Forms Authentication). When the user first logs into the application, IIS prompts the user for...
6
by: Frank Walsh | last post by:
Can anyone tell me if this is possible in asp.net, I want to use form-based authentication to authenticate my users, however a employee of the company is attempting to be logged in as administrator...
1
by: =?Utf-8?B?VCBSYXkgSHVtcGhyZXk=?= | last post by:
I have an ASP.NET 2.0 web app using forms authentication and an ASP.NET Membership database. Internal users access the app from the intranet, but they are authenticated by the membership module....
1
Carrugar
by: Carrugar | last post by:
Hi folks, I am issuing the net use command on a couple of Win2003 servers. Some of these servers require that the name and password be authenticated twice and other servers just once, i.e.: ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
1
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...
0
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...
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...
0
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...
0
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 ...

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.