how to create a dynamic session
-
Dear sir, ==>I had A login Page. ==> Every User Will Access the application After The Successfull Login. ==> After Successfull Login Im Storing The Username In a Sesssion. ==> Because I Have To Use The Username In Several Pages in my webapplication. ==> until this i had no problem. ==> now the probelm arised because of the following case.. ==> let the user 'A' be logged on to the application and working. ==> the the session will store the username of 'A'. ==> the problem is If another user 'B' logged on to the application,then the session is overwritted by the by the 'B's user name and i m losing the 'A's user name which is stored previously in the session. ==>Now what i have to know is Is there Any Way to create a dynamic session which means if a user logged on then a session to be created for him independent of othe users.. thanks in advance. vishnu.
-
Dear sir, ==>I had A login Page. ==> Every User Will Access the application After The Successfull Login. ==> After Successfull Login Im Storing The Username In a Sesssion. ==> Because I Have To Use The Username In Several Pages in my webapplication. ==> until this i had no problem. ==> now the probelm arised because of the following case.. ==> let the user 'A' be logged on to the application and working. ==> the the session will store the username of 'A'. ==> the problem is If another user 'B' logged on to the application,then the session is overwritted by the by the 'B's user name and i m losing the 'A's user name which is stored previously in the session. ==>Now what i have to know is Is there Any Way to create a dynamic session which means if a user logged on then a session to be created for him independent of othe users.. thanks in advance. vishnu.
Sessions are independent, for each user in each browsing session. Try logging in as user A in IE, then as user B in Firefox and you'll see all is well. But of course only one user can be logged in on the same computer using ther same browser at the asme time.
-
Dear sir, ==>I had A login Page. ==> Every User Will Access the application After The Successfull Login. ==> After Successfull Login Im Storing The Username In a Sesssion. ==> Because I Have To Use The Username In Several Pages in my webapplication. ==> until this i had no problem. ==> now the probelm arised because of the following case.. ==> let the user 'A' be logged on to the application and working. ==> the the session will store the username of 'A'. ==> the problem is If another user 'B' logged on to the application,then the session is overwritted by the by the 'B's user name and i m losing the 'A's user name which is stored previously in the session. ==>Now what i have to know is Is there Any Way to create a dynamic session which means if a user logged on then a session to be created for him independent of othe users.. thanks in advance. vishnu.
First thing, you have very wrong Idea about session. Session object is unique for every user.means, data stored by a user in session would not be override by another user's session data data. You must be doing something wrong. For details, have a look one good link on CP itself. Exploring Session in ASP.Net
Cheers!! Brij Visit my Blog: http://brijbhushan.net
Check my latest Article :ViewState - Various ways to reduce performance overhead -
Dear sir, ==>I had A login Page. ==> Every User Will Access the application After The Successfull Login. ==> After Successfull Login Im Storing The Username In a Sesssion. ==> Because I Have To Use The Username In Several Pages in my webapplication. ==> until this i had no problem. ==> now the probelm arised because of the following case.. ==> let the user 'A' be logged on to the application and working. ==> the the session will store the username of 'A'. ==> the problem is If another user 'B' logged on to the application,then the session is overwritted by the by the 'B's user name and i m losing the 'A's user name which is stored previously in the session. ==>Now what i have to know is Is there Any Way to create a dynamic session which means if a user logged on then a session to be created for him independent of othe users.. thanks in advance. vishnu.
vishnukamath wrote:
the problem is If another user 'B' logged on to the application,then the session is overwritted by the by the 'B's user name and i m losing the 'A's user name which is stored previously in the session
Hi, Are you sure that you are using Session object (which is for each users) and not Application state (which is common for all users or sessions) Eg:
//Session Object
Session["UserName"] = txtUserName.Text;//Application Object
Application["Message"] = "Message to All users";Sujith My Blog
-
Sessions are independent, for each user in each browsing session. Try logging in as user A in IE, then as user B in Firefox and you'll see all is well. But of course only one user can be logged in on the same computer using ther same browser at the asme time.
Dear Sir, First Of All Thanks For Replying me. Now Actually My Problem Is Suppose If The User 'A' Is logged on to the system "A"(for ex). Now If The Same User 'A' HAs Logged On to Another System say "B" then Im Prompting That "You are Already logged on another system.do you want to end that session?" if the user clicks ok then i have to end the session of user "A" who is logged on to the system "A". now he should logged on to the system "B". Is there Any way to solve my problem? Thanking You Sir, vishnu.