Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5847113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:40:21+00:00 2026-05-22T12:40:21+00:00

I am developing an ASP.NET MVC 3 Application that is essentially a proxy to

  • 0

I am developing an ASP.NET MVC 3 Application that is essentially a proxy to a database. To login, users must provide their database user and name. (I know it isn’t a good idea to use database users as application users, but I didn’t design the database, so don’t blame me.)

When my users log in, I would like to store in a session variable their username and password:

Session["UserID"] = TheConnectionStringBuilder.UserID;
Session["Password"] = TheConnectionStringBuilder.Password;

However, session state is not intrinsically tied to the authentication cookie, and this could cause problems later. Is there any way to keep session state data in such a way that it remains tied to the authentication cookie?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:40:22+00:00Added an answer on May 22, 2026 at 12:40 pm

    One of the way could be matching session state time-out with authentication time-out using configuration. For example,

    <authentication mode="Forms">
     <forms timeout="30" />
    </authentication>
    
    <sessionState timeout="31" />
    

    Yet another way would be to store credentials into some persistent store (such as file) tagged with some generated key and then keep this key in authentication cookie. However, I feel this is a round about way of doing things and I would rather go with session approach.

    For some reason, if you don’t find the user id/password in the session (for example, application pool recycle), you can force user to re-login (by using FormsAuthentication.SignOut followed by RedirectToLoginPage).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an ASP.NET MVC application that will send the user a confirmation email.
We are developing an ASP.NET MVC Application that currently uses it's own database ApplicationData
I am developing an Asp.Net MVC application that uses Google maps to show Addresses
I am developing an asp.net mvc web application that makes much use of jquery
I'm developing an ASP.NET MVC 2 application that connects to some services to do
I'm interested in using Subsonic 3.0 for developing a new ASP.Net MVC application that
Im developing a web application in asp.net mvc (c#) that has a form and
Hello i am currently developing a ASP.NET MVC 3 application that uses the new
We're developing a reporting application that uses asp.net-mvc (.net 4). We connect through DDTEK.Sybase
I am developing an ASP.NET MVC application and I want to use OpenId. What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.