State Management :: Shared Variable But Specific To One Login?

Apr 28, 2010

I dont know if im writing in a right place. this is about class in App_Data (asp.net) folder that i want to user throughout system. but specifically for one user.

lets say userA login to the system. then system will use classUser
FillProperty and set variable like Name, Username, UserId (a property of his own, the modifier is
shared). the purpose is so that it can be used in any page. it behaves like
user.identity.name (when we want to call name of user that already authenticated)

I can do it fine. but once i test login with UserB in other browser, it change that shared variable with property of userB.what i want is, when A login, he will set the classUser with his data and data that called by him is his data. and when B login, he will do the same, but he will use his data without replacing userA data.here is the code :

-------------- CLASS -------------[Code]....

View 5 Replies


Similar Messages:

State Management :: Session State Is Shared Between The Tabs?

Aug 6, 2010

We have a common problem with tabbed browsing in Internet Explorer is that the session state is shared between the tabs.

Due to this our user can face many issues like

1) Suppose user has opened a .aspx page for (clientId=1) and editing it in one tab and at the same time user is editing another client(ClientID=2). And both are using same in session.

Due to the session sharing when page will auto refresh the first tab with (clientId=1) will see the data of clientId=2.

Its clear that the session is shared between the tabs.

I have also implemented the ASP.NET 2.0 offered solution by way of the following config setting
<sessionState mode="InProc" cookieless="UseUri"></sessionState>

But still our users are facing this issue. I am looking for solution to disabled the Tab programaticaly and also i wanted to know how to clear the cache programatically.

View 7 Replies

State Management :: State Management Using Shared Class?

May 29, 2010

I am doing a POC of making my website run faster. Currently it stores huge object data in Session while passing information from one page to another. What I was thinking is to use shared methods and properties instead of session. It works, but wanted tocheck if this is an optimum way to do it. Below is the code that does not use session but still pass object data from one page to another:

[code]...

View 1 Replies

State Management :: Public Variable Vs Session Variable To Store Logged In UserID

May 17, 2010

I have a web application which uses a session variable to store the logged in userid. If no user is logged in, of course this variable will be empty and the contents displayed on my website are meant for guests. If there is a user logged in, the user specific controls/access/links will then be a displayed.

I am now having issues with my hosting where on shared application pool, the worker recycle is triggered every 90 minutes, this will clear sessions causing all my users to be logged out. I opted for a dedicated application pool, which got worse because I am only allocated 50MB memory limit and if this is reached, the worker recycle is triggered and I lose my sessions again. I have tried as much as possible optimization techniques, e.g. dispose where possible, close connections, disable viewstate for static controls etc but my memory per instance keeps building up from page to page without any signs of improvement. I don't use loops nor store huge objects like bitmaps etc but my sessions are now gone even faster than 90 minutes in shared application pool before.

I have considered using SQL Session State but there isn't a simple guide on using this with MySQL. I am getting desperate and considering using a public variable, a string as a replacement to store logged in user id instead of in a session variable. I am pretty sure this will solve my issue with sessions being recycled but are there any negative consequences of doing this? One problem I can think of is if the user closes the browser, the system will never know that the user is now logged out and this public variable should be nothing. In this scenario, will the GC eventually clear this abandoned public variable.

View 10 Replies

State Management :: Session Getting Shared Among Different Users?

May 19, 2010

[Code]....

Above is my configuration.

Because one user is getting the session values of other users due to some reason that I dont know .

View 3 Replies

State Management :: Static/Shared Confusion?

Sep 16, 2010

my understanding static/shared objects will be saved in a memory that is shared by all instances of the asp.net application,so if we set a value to shared object from inst1 & i should be able to access it via instance2(may be in same computer or anywhere)Actually:In my vb.net application,previously they defined shared dataset to hold some information specific to the user,still now i cant reproduce the error that same value shared across all application instances.Please help me to solve or clarify this.
[URL]

View 3 Replies

State Management :: Object Is Byref And Shared?

Apr 14, 2010

I have a Session Varaible in which I am assinged a List of "MLoad" objects (Ex:- 10 MLoad objects) from the initial search. After that basing some icon click i am trying to get the new filtered results (Ex:- say 1 MLoad object) and assigning them to the public property "ListSearchResults" (See code below). When i do this the original results in the Session are changed(10 MLoad objects are getting replaced with 1 MLoad object ==> which just been filtered). What i have to do so that the "ListSearchResults" in Session is not changed. It is now byref, how to make it byval?

in acreate an object See below code and after retreving t

[Code]....

View 1 Replies

State Management :: Cache Settings On Shared Application Pool?

Sep 17, 2010

I have several web applications on a server using the same application pool. The worker process usually takes a lot of ram but usually only from one application. I can successfully limit the cache usage by setting "PrivateBytesLimit" in web.config file when the application uses it own dedicated application pool.

Does anyone know how this setting will be applied when using shared application pool? Is it per application, per worker process or per application pool? Also if it is not per application which setting from which application will be applied?

View 1 Replies

State Management :: Session Variable Authentication State Timeout?

Dec 3, 2010

I am building a web app that is limited to one database, therefore I cannot use the ASP.NET config tool. As a quick means of getting this app online, I tried to use a simple session variable. The login page verifies the user's credentials, and if they pass, it sets the session variable to a certain value. All other pages check in the page_load event whether or not the session variable is equal to that value. The problem is that once being logged in for a short while and sending and recieving some data, the session variable resets, and I'm returned to the login page to repeat the process. Here's the basic code from my webforms:

[code]....

Is there some setting I need to change in the web.config file to adjust the cookie timeout or is that only for the config tool authentication methods?

View 5 Replies

State Management :: Int Variable Value Not Getting The Stored Value

Mar 17, 2011

I have define a variable called number of type int just after the the class definition as follows.

[Code]....

I store a value from a sql query result in the Number variable. ( eg: lets say 23). This gets assigned correctly to theNumber variable. ( checked using a break point)

Then the user does some updates to the web page ( data entry). The web page includes post back events also.

Finally I need to update the webpage in the database. When I do this I see the Number variable has change to 0. ( and not the 23 as in our example). Its always 0 at the time when I update.

I do not do anything for the number variable in the code.

View 5 Replies

State Management :: How To Terminate The Session After Specific Time Duration

Apr 24, 2010

I want to terminate the session after specific time. So how can solve it.

View 3 Replies

State Management :: Opening A Specific Page When Application Loads?

Mar 20, 2011

I would like to have following feature in my ASP.NET 4.0 application (I would prefer C# code):

On the start of application, the code checks

if User == Administroator
then load page1
else if user = customer
then load page 2

View 2 Replies

State Management :: Session Variable In Mshtml?

Jan 18, 2011

i want to use seession like variable in mshtml.

View 1 Replies

State Management :: Passing The Variable To Another Page?

May 3, 2010

want to use the value of a variable on to the other page, what i am supposed to do for that.i am novice at asp.net

View 8 Replies

State Management :: Losing A Value Assigned To A Variable?

Dec 28, 2010

I'm fairly new to ASP.net development as may have been noticed by some of my other posts and so here goes another one.I have a web page in which I allow users to enter data that will be used to populate a database and then graph data based on the information that was saved in the database. I have 10 sets of criteria that the user can enter and as they enter values for each individual set, I make sure all the parameters are filled in and set a variable called blnParm1, blnParm2, blnParm3, etc. Anyway, as each DropDownList box fires off an event the values of my blnParm variables is reset because each time the event is fired the page is PostBack therefore my variables are redeclared. I know the page is being PostBack because each of the DropDownList boxes have AutoPostBack set to true. I had to do this so that I could get the OnSelectedIndexChanged event to fire for each of the DropDownList boxes. So, how do I preserve my variables through this PostBack or how do I get the events to trigger without calling AutoPostBack?

Some more info, my variables are declared globally in my aspx.cs file as private bool. The code is working like it should as far as populating drop downs dynamically based on other data input by the user, the controls all have their values preserved as the page is PostBack.

View 2 Replies

State Management :: Get A List Of Session Variable?

Jun 16, 2010

Each time a session starts, I save

Session("UserName")= xyz$

My question is:

what would be the vb code to get a list of all "UserName" 's

(session alive at this moment) ?

View 7 Replies

State Management :: Access Session Variable?

Jul 18, 2010

I have two projects ,one is webforms and other is Business logic, i am storing username in Session Variable, i have audit module in businss logic which has event handlers to do auditing on object create / remove. i want to store username in audit trail, i want to save username in some global place which is session bounded so that i can get the username in my audit module.i dont want to refer System.web, or httpcontext in my businesslogic project.pls help how i can acheive this. i found this article but cudnt understand much.

"Now one option if you want to have your DLL pull the stuff from Session is to abstract out session. So you could define an interface like IStorage, that your library will know how to use. Then you can have a SessionStorage or MemoryStorage class and use IoC to inject the appropiate class into your library classes. This gives you the freedom to code it how you wanted it to be coded without tying your code to Session. Oh and one other benefit if done properly can be used to not tie your code to session in the web either.

View 7 Replies

State Management :: Cache Vs Static Variable?

Sep 24, 2010

I know the big difference, but one thing is confusing me. Cache works only on a single machine on webfarm and to make it globally we use Velocity or memcache.So is static does same, or is it already work globally ?
eg

Cache["someid"] = "value"; //this will only work on single machine cache,

static string abc = "value"; // will this work on single machine or globally ?

View 6 Replies

State Management :: Session Variable Use / IsolatedStorage?

Feb 20, 2010

I am using ASP.NET 2.0I am little bit confuse about using of Session Variable. I have a three page web application. When a user login, after verification of user credentials I get user ID from DB and store this ID in a session variable.Session("USERID") = 56by using this ID I can get 20 different values from database as User Full name, user date of birth, user location, user date of joining, User Commission rate etc. I need some of these values in Page 1, some in page 2 and some values needed in Page 301. After successfully login and getting the User ID, I take all these 20 values from Data Base and store these values in an ArrayList and store this ArrayList in a seesion and whenever I need to use any value I take these values from ArrayList which is save in Session variable.

View 6 Replies

State Management :: Looking For A Way to Declare A Global Variable?

May 14, 2010

I'm looking for a way to declare a global variable (so all pages could see) but personal (so if one user puts some value in it, it won't matter to another user or change his value).Sessions and hidden fields won't do. I've tried working with declaring keys in Web.config but unfortunely, the keys values aren't personal, and all users share the same key value.Another way I was thinking was maybe classes, but perhaps there might be an easier solution?

View 19 Replies

State Management :: Store 2 Arrays In One Session Variable

Apr 21, 2010

I have 2 arrays declared like this :

[Code]....

and i wish to put both in one session variable and then retrieve it to get one array like:

{"intItemID","strCategory","strType"}

View 3 Replies

State Management :: Store An ArrayList Into A Session Variable?

Apr 23, 2010

I'm looking store an ArrayList into a session variable, but am having a few problems. Can you spot anything wrong?

public partial class _Default : System.Web.UI.Page { ArrayList score = new ArrayList(); protected void twist2(object sender, EventArgs e) { int a = 11; int c = RandomNumber(a); score.Add(c); score = (ArrayList)Session["scoreData"]; Result.Text = (c).ToString(); String Result_id = Result.Text; int total = 0; //Session["scoreData"] = score; for (int i = 0; i < score.Count; ++i) { total += (int)score[i]; } Sum.Text = (total).ToString(); String Sum_id = Sum.Text; }

View 3 Replies

State Management :: How To Save Username In Session Variable

Apr 20, 2010

I am building a simple search interface for one of our existing systems. I am using windows authentication. What I would like to do is grab the username of the logged in user via httpcontext.current.user into a session variable on page load and use it in various places on my page. My problem is that when i run my code in debug mode from visual studio it works fine. But when i try to run my code from the browser using localhost it does not work.

View 4 Replies

State Management :: Setting Session Variable From Formview

Apr 13, 2010

I'm building a site (it's amazing how much you can do and still not know what you're doing).I have my visitor login from a login.aspx page and, when authenticated are redirected to a Portal page. On that Portal page at pageload I set a Session variable "UserName" using the User.Identity.Name like this:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If User.Identity.Name <> "" And User.Identity.IsAuthenticated = True Then
If Page.IsPostBack = False Then
Session("UserName") = User.Identity.Name
End If
[code]...

View 4 Replies

State Management :: Storing Datatable In Session Variable?

Oct 28, 2010

I am storing Datatable in Session variable in my project. Is it good practise to do so? The datatable has 20 fields and can run into 1000+ records. Will it hamper my application performance?

View 11 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved