Simple (I suspect) Session Oversight with asp logins on shared server

0 views
Skip to first unread message

DanWeaver

unread,
Apr 14, 2008, 7:23:49 PM4/14/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi,

I am going mad with this. I seem to have what I imagine is a simple
session problem.

You can see the behavior at www.joglab.com where Ive set up the
scenario.

Trying to use a simple login seems to work ok- it writes to the
database:

New user (Choose New 'un)
user:
newuser142205

pass
newuser142205*

...when this user logs in it continues to the default page- which is
the correct continuation behaviour. In the DB the user is shown as
having logged in at that time.
It does not inform user that login is no good.
But the continuation page (default.aspx) shows the user as not logged
in- not showing their user name and showing status as 'login' not
'logout'- login views neither.

I am using the following in in web.config:

<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data
Source=HYDROGEN;Initial Catalog=thedb;Integrated Security=false;User
Id=blahuser;Password=blahdeblah;"
providerName="System.Data.SqlClient" />
</connectionStrings>


If I set Integrated Security=true on logging in I get:

Login failed for user ''. The user is not associated with a trusted
SQL Server connection

The Web Site Administration Tool cannot connect to the server from the
local machine- I suspect that this is a wild goose though.

If you dont know the answer to this then perhaps you know a simple way
to disable the non-alphanumeric requirement in passwords which is a
pain in the ass!

I have been following this:
http://weblogs.asp.net/scottgu/archive/2006/12/22/recipe-deploying-a-sql-database-to-a-remote-hosting-environment-part-1.aspx

Any help would be very much appreciated.

Dan

Andrew Badera

unread,
Apr 15, 2008, 1:16:25 PM4/15/08
to DotNetDe...@googlegroups.com
1. You can edit the password strength requirements by utilizing attributes of the MembershipProvider element in web.config.
2. ASP.NET config can't connect? Do you have multiple dev server (Cassini) or IIS instances already running? If you alter the URL after the app config can't connect, and use one of the other local instances, can you connect?
3. Your user might not show as logged in on default.aspx for any number of reasons that we can't possibly discern without seeing your code.
3a. I think your user IS logged in. Show us the code.
--
--Andy Badera
http://andrew.badera.us/ http://flipbitsnotburgers.blogspot.com/
and...@badera.us
(518) 641-1280
Google me: http://www.google.com/search?q=andrew+badera

DanWeaver

unread,
Apr 15, 2008, 6:14:48 PM4/15/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi Andy,

Thanks for your help. The code for the pages is below but Im not sure
which code is germane.
I have not pasted web.config- the only thing Ive changed in
web.config is the connection string...

<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data
Source=HYDROGEN;Initial Catalog=thedb;Integrated Security=false;User
Id=blahuser;Password=blahdeblah;"
providerName="System.Data.SqlClient" />
</connectionStrings>

...the rest of the web.config file is standard as created by Visual
Web Developer 2008.
The not-working version is at www.joglab.com and trimmed default and
login pages pasted below. I dont have Casini and dont think I have
multiple IIS instances running, but these pages are on a shared server
and refer
to a db on server local to that host (HYDROGEN). Is it to do with
Integrated Security=false ?

>"If you alter the URL after the app config can't connect, and use one of the other local instances, can you connect?"
Im afraid I dont understand how to do this test...when I hit 'test'
AspNetSqlProvider in the providers section of the Web Site
Administration Tool I get "Could not establish a connection to the
database."
(http://localhost:50812/asp.netwebadminfiles/providers/
ManageConsolidatedProviders.aspx)

Default.aspx
.....
<form id="form1" runat="server">
<div>

</div>
<asp:LoginStatus ID="LoginStatus1" runat="server" />
<br />
<br />
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
Logged in indeed
</LoggedInTemplate>
<AnonymousTemplate>
Not logged in ok
</AnonymousTemplate>
</asp:LoginView>
<br />
<br />
logged in as:<br />
<asp:LoginName ID="LoginName1" runat="server" />
</form>
.....

Login.aspx
.....
<form id="form1" runat="server">
<div>

</div>
<asp:Login ID="Login1" runat="server" CreateUserText="new un"
CreateUserUrl="~/newuser.aspx" DestinationPageUrl="~/
Default.aspx">
</asp:Login>
</form>
.....

DanWeaver

unread,
Apr 16, 2008, 1:50:12 PM4/16/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting

Hi Andy,

POSTED TO http://groups.google.co.uk/group/DotNetDevelopment/browse_thread/thread/a830f4a5f00f732a

1849 London Time 16 April 2008- Similar Response posted c20 hours ago
but not appeared for some reason.

Thanks for your help. The code for the pages is below but Im not sure
which code is germane. I have written absolutely no vb/c code- just
trying to sort out the basic login behaviour first.
I have not pasted web.config- the only thing Ive changed (from
standard visual web developer startup) in web.config is the connection
string...

www.joglab.com shows the problem.

<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data
Source=HYDROGEN;Initial Catalog=thedb;Integrated Security=false;User
Id=blahuser;Password=blahdeblah;"
providerName="System.Data.SqlClient" />
</connectionStrings>

...the rest of the web.config file is standard as created by Visual
Web Developer 2008.
The not-working version is at www.joglab.com. I dont have Casini and
dont think I have multiple IIS instances running.
Is it to do with Integrated Security=false ?
"If you alter the URL after the app config can't connect, and use one
of the other local instances, can you connect?"
Im afraid I dont understand how to do this test...when I hit 'test'
AspNetSqlProvider in the providers section of the Web Site
Administration Tool I get "Could not establish a connection to the
database."
http://localhost:50812/asp.netwebadminfiles/providers/ManageConsolidatedProviders.aspx
Reply all
Reply to author
Forward
0 new messages