i am calculating cityid and then save it in session and then save this cityid in table with other data.For example i calculate cityid in ifram or anyother handler or ascx etc etc.and then returns to that function to save those information including cityid.
Now as we must have more than one user sharing this code and hence application.one will set session to 1 and other will set to 2.as i am using one cityid and one session for all user then how i ll distinguish among users?will it not overwrite it?how i can
have check that this cityid belongs to this user?
In your scenario you have to save object in session rather then simple "cityid" .
if you have user object then add an other attribute in it with the name "CityId" and update the current user object with the city id and add your updated object in session so that you will be having "CityId" against "UserID".
objuser.CityID=1
Session.Add("SysUser",objUser);
Another secnarion is that if You want to maintain multiple user in the same session then maintain collection of user in the session.
shafiqkr
Member
454 Points
372 Posts
Session Value Issue
May 13, 2012 07:28 AM|LINK
Hi,
i am calculating cityid and then save it in session and then save this cityid in table with other data.For example i calculate cityid in ifram or anyother handler or ascx etc etc.and then returns to that function to save those information including cityid.
Now as we must have more than one user sharing this code and hence application.one will set session to 1 and other will set to 2.as i am using one cityid and one session for all user then how i ll distinguish among users?will it not overwrite it?how i can have check that this cityid belongs to this user?
kashif786
Member
312 Points
83 Posts
Re: Session Value Issue
May 13, 2012 07:42 AM|LINK
hi,
In your scenario you have to save object in session rather then simple "cityid" .
if you have user object then add an other attribute in it with the name "CityId" and update the current user object with the city id and add your updated object in session so that you will be having "CityId" against "UserID".
objuser.CityID=1
Session.Add("SysUser",objUser);
Another secnarion is that if You want to maintain multiple user in the same session then maintain collection of user in the session.