Click here to Skip to main content
13,139,254 members (53,665 online)
Rate this:
Please Sign up or sign in to vote.
Hi ,

We are trying to store a session in SQL server 2008 r2 using load balancer.We have 2 websites developed in .net 4.0 framework and created a same DNS name for the web sites .When we tried to access the both web applications the session database is creating two rows.

Both applications are creating seperate sessions for the same user .We want to make the websites to share same session in DB.We are unable to share between sessions.

Can anyone help me.

Posted 6-Mar-13 15:55pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try below logic.(Two application are app1 & app2. User name is u1)
 1. U1 login to app1(In DB a new row will insert for storing app1 session)
 2. u1 login to app2
    1. Check any open session is available in DB (You can use Session_Start event for this)
    2. if available then restore DB session(app1 session) to app2 application.
    3. if not available start new session and insert into db (Do the same logic in app1)
If you have any doubt pls ask.
Prashant Bangaluru 7-Mar-13 3:58am
We are unable to do this can you please provide the sample code. when we searched in google, they mentioned to have the application name same in the webfarm. Do you have any idea to update the same application name for both websites.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170915.1 | Last Updated 6 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100