Results 1 to 5 of 5

Thread: Storing DB username/password for multiple pages

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Question 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?

  2. #2
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    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.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Re: Storing DB username/password for multiple pages

    Quote 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?

  4. #4
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    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")

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    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
  •  



Click Here to Expand Forum to Full Width