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

  • SEARCH
  • Home
  • 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 9130877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:02:44+00:00 2026-06-17T08:02:44+00:00

I used a sql server session mode between two web applications. The session id

  • 0

I used a sql server session mode between two web applications.
The session id is created in the ASPState database. I need to share the session id from first application to second without using querystring and cookies. I followed the steps from this link. Below is the code.
In both apps (web.config)

<add name="DBConnection" connectionString="Data Source=localhost;DataBase=ASPState;Integrated Security=True;uid=sa;pwd=password-1" providerName="System.Data.SqlClient"/>

<sessionState mode="SQLServer" sqlConnectionString="DBConnection" allowCustomSqlDatabase="true" regenerateExpiredSessionId="false" cookieless="false" timeout="1" ></sessionState>         

<machineKey validationKey="566A547C407CB0C47ABAEC581B8B90C45E15039806352E4611B35E0FB70C1C096350A4BBAE816191331DCA55874D3F96B41FFDED4C6A913591684A90825F53A0" decryptionKey="B299127DFC22648C2EF92D7EDF2E4960277F562C60F3BDE4A4C3BFDFEA602FDF" validation="SHA1" decryption="AES" />
<modules runAllManagedModulesForAllRequests="true">    
<add name="BasicAuthenticationModule" type="UserAuthenticator" />
</modules>

In first app Home.aspx.cs

protected void imgBTN_Click(object sender, EventArgs e)
{
   string sessionKey = HttpContext.Current.Session.SessionID;
  //How to transfer the same session id to the second application
   Response.Redirect("http://localhost:43392/PartnerHome.aspx"");
}

I got the session key from ASPState database. But how to pass from the same session id to the second application ?

  • 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-06-17T08:02:45+00:00Added an answer on June 17, 2026 at 8:02 am

    You can use SessionManager to set the ID to whatever you want in the target site. You just need to pass it via querystring GET or form POST from one to the other:

    Source

    Response.Redirect("http://localhost:43392/PartnerHome.aspx?SessID="
        + Session.SessionID);
    

    Target

    string sessionId = Request.QueryString["SessId"];
    bool redirected = false;
    bool isAdded = false;
    new System.Web.SessionState.SessionIDManager().SaveSessionID(
        HttpContext.Current, sessionId, out redirected, out isAdded);
    

    See SessionIDManager on MSDN

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

Sidebar

Related Questions

Thus far used sql server stored procedures for all my web applications... Now thought
Platform used : Microsoft Visual Studio 2010 (C#) Database : SQL Server 2008 R2
I have just downloaded SQL Server 2005 express edition from here: To be used
I have two SQL Server (2000) databases. Both are used for the same project,
I copied a SQL Server database from one system to the next, identical setup,
We want to store session in SQL Server. We have sessionState mode=SQLServer. I have
When I used SQL Server Management Studio to display the estimated execution plan of
I have used SQL SERVER 2005 & c# .net for front end & app.config
We have SQL Server 2008 R2 and Visual Studio 2008. I have used the
SQL Server doesn't support the SELECT FOR UPDATE syntax, which is used by NHibernate

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.