Click here to Skip to main content
14,034,985 members
Rate this:
 
Please Sign up or sign in to 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

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

Solution 1

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[^]
   
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web02 | 2.8.190424.1 | Last Updated 15 Apr 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

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