Click here to Skip to main content
15,895,801 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
We have web application, in that we using session variable to store username,userid when login page and passing to other pages ,What happen in my web, i showed at top "Welcome Username in label in each page , so in each page load i use session("username").ToString value assign to that label, if 10 user login at a same time each user getting their name , then any one logout and login again, what happen other all users just go to other page will get session of username at top as which user is recently logged out and login again username.

How possible ? still other user have their own name in session variable but seeing recently user login name ? p.net

What I have tried:

I put log entry in page load with ip and session values store in log file, i call each page in button click event in server side, what happen it will not hit server side code,but redirect to correct page, first time only hit page load code in server side, then after that never hit.

Browser anything store cache or cookies ?

Pls reply asap, Thanks
Regards,
Aravind
Posted
Comments
F-ES Sitecore 15-Apr-19 10:20am    
It'd look to see if the page or the portion that shows the username is being cached anywhere. The behaviour you describe isn't normal so there is something specific to your solution that is causing this.

1 solution

Sessions are unique per user. You just need to make that you remove/abandon the user session on logout. You should take a loot at this article: How To: Use Forms Authentication with SQL Server in ASP.NET 2.0 | Microsoft Docs[^]
 
Share this answer
 
Comments
Aravindba 16-Apr-19 1:20am    
yes correct when logout i put these code for clear session of username, and then redirect to login page , any other code to clear session ?

Page.Response.Cache.SetCacheability(HttpCacheability.NoCache)
Session.Clear()
Session.RemoveAll()
Session.Abandon()

Any other problem in web config ?
Recently i changed following changes in webcofig
<customerrors mode="On" \>
<compilation debug="false" \>
<trace enabled="false" \> <httpruntime enableversionheader="false" requestvalidationmode="2.0" \>
<httpprotocol>
<customheaders>
<clear>
<add name="X-Frame-Options" value="sameorigin">
<!--<add name="X-UA-Compatible" value="IE=8">-->


<modules runallmanagedmodulesforallrequests="true">
<validation validateintegratedmodeconfiguration="false">

Regards,
Aravind

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900