Click here to Skip to main content
Rate this: bad
good
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.
 
Thanks
Prashant
Posted 6-Mar-13 16:55pm

1 solution

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

Solution 1

Hi,
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.
  Permalink  
v2
Comments
Prashant Bangaluru at 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
0 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Sergey Alexandrovich Kryukov 105
4 Afzaal Ahmad Zeeshan 82
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web03 | 2.8.1411022.1 | Last Updated 6 Mar 2013
Copyright © CodeProject, 1999-2014
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