|
-
Apr 6th, 2005, 10:16 PM
#1
Thread Starter
Frenzied Member
Storing DB username/password for multiple pages
I have an https login page for SQL Server and several other pages that will need to connect with the same login info. Is it safe to store this info. in Session variables to use for the connection?
-
Apr 7th, 2005, 10:37 AM
#2
PowerPoster
Re: Storing DB username/password for multiple pages
As far as I know session variables are safe in terms of security beczuse they reside on your server.
Are you trying to save the connection string in the session variable, then I guess you can go ahead and save it, but wouldnt that be hard-coing of the string? and later if you need to change the string that would require you recompile the dll. Instead I would suggest that you save the connection string in the web.config file in encrypted format.
-
Apr 7th, 2005, 01:41 PM
#3
Thread Starter
Frenzied Member
Re: Storing DB username/password for multiple pages
 Originally Posted by veryjonny
As far as I know session variables are safe in terms of security beczuse they reside on your server.
Are you trying to save the connection string in the session variable, then I guess you can go ahead and save it, but wouldnt that be hard-coing of the string? and later if you need to change the string that would require you recompile the dll. Instead I would suggest that you save the connection string in the web.config file in encrypted format.
How can I save to and access it in the Web.Config?
-
Apr 8th, 2005, 01:20 AM
#4
PowerPoster
Re: Storing DB username/password for multiple pages
in Web.Config
<appSettings>
<add key="ConnStr" value="coneectionstring"/>
</appSettings>
Code:
'To access in your forms or modules
dim StrConn as string = Configurationsettings.appsettings("Connstr")
-
Apr 8th, 2005, 08:46 AM
#5
Thread Starter
Frenzied Member
Re: Storing DB username/password for multiple pages
But if my user name and password are not constant then I won't have any choice but to store session variables and tac them onto the end of the connection string, right?
I have a login page to verify the SQL Server login. How can I verify whether the login is correct and redirect to an error page if not or to the correct page if successful?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|