After a looong night managed to change Session mode from inProc to SQLServer but still can't get the session variables to be saved
Hi,
I ran my Shopping Cart project and somehow everything worked fine(while in
inProc), session variables were saved fine. I made some changes to my
project and since then keep getting null session variables, no matter
what I do. It took me the whole night to figure out how to turn to
SQLServer mode, marked custom classes as 'Serializable' with [Serializable] before the class definition but
everything's in vain. Getting the same damned 'nulls' instead of the
saved objects.
private void Page_Load(object sender, System.EventArgs e)
{...
Loosing session state when I call a session variable from a derivated class
Hi folks I'm having an annoying problem. I have a web application which is used to edit some database data. The databases content may be in various languages, having one database for each language. I load a database calling it by the database name and the language suffix (for example: database_eng, when 'eng' is the laguage variable). So, I need to set a session variable 'Language', which is used in any webpage that calls information from a database. The problem I have is in some classes, which stores some methods to obtain information from databases. These clas...
State management upon session variable changes
I noticed that whenever a session variable is changed...the application knows about it and suddenly restarts session.
My question is does restart "ALL" sessions or only the active sessions for which the variables changed?
Imagine a "multi-user" application all with different states and an administration panel that lets you change session variables. In this case, my question has to do with the question that if Company X changes his session variables, will only Company X's sessions be reset or will all "sessions" be reset? Hope that makes sense.
...
Using Session Variables inside a VB.Net Class File
I am developing an asp.net web site, using VB.Net as the core language, and have create a class file to store some global methods I use on a number of pages.
When I try to implement a session variable inside a class in this manner:
Imports Microsoft.VisualBasic
Namespace ChileNavy.global.SessionVars
Public Class SessionVars
Public Sub initializeVars()
If Session("UserID") Is Nothing Then
Session("UserID") = "SomeDefaultSetting"
End If
End Sub
End Class
End Namespace
I get an error "Session not declared". Suggesting that the class file sees this is a variable....
Session variables vs. Session States
What is the difference and in what situations are they used.
Thanks,
Mattypee
A session state (the state of your session) holds your session variables. If your session state expires (due to inactivity) then you lose your session variables...and any other info stored for that session.
If you need to store USER specific information within a web app, then session variables are one(of several) ways to do it.
MajorCatsMajorCats
Is there any code that you could show that would give an example?
Thanks,
Mattypee
example of what? reading and writing session variables?
...
session variable cleared before session expires
I have web site developed in ASP.NET & c#. The problem is the session variables are cleared before the session expires. All the session variables are cleared before the session_end event fires. Please suggest probable reason for that.
thanks
Jog...
Session Variables Vs Session Class
Hi All,
I am rewriting a classic ASP application in .NET using ASP.net and C#.
We used Session Variables to handle storing the current user information throughout the original application. I was wondering what the benefits would be of using a Session Class over Session Variables, and also how I could implement this?
Many thanks in advance for any information you can give me.
Regards,
Aj
Check this out.
I think Session class always beneficial since you have more control over accessing and setting your session variables and exception handling. Check the link for its sample implem...
Getting Session ID and Session ID CHanging
I am building a cart, and when the user first accesses the site, I want to grab their SessionID. For some reason, I cannot get that Session ID when the site first pops up. I have a Session_Start() and Application_Start() function in the global.asax file.
My other question is that everytime a page is loaded, a different session ID is grabbed and I am not sure why that would happen. Shouldn;t the Session ID always be the same while the user is on the site or the session timesout?
Thanks
If you don't use/store something in Session state during a user's Session, it will use a different ...
Session State Variables across multi sessions
I am having an issue where I save my DataTable into a Session Variable: Session["dtDMFile"] = dtDMFile; Different users can use the web form that I created. Once the data is loaded,I send the DataTable to the session variable. My problem is that when I go to reload the data in the table, it is taking the data from the last user who stored the DataTable instead of from the particular user on their browser. For instance, User 1 (machine 1) loads data with field contents of: field1 field2 field3 User 2 (machine 2), then loads data with field contents of: f...
session variables getting changes
Hi,
I am having 2 frames in my page top_frameand middle_frame, the top frame has got a dropdown list, now i am calling a function in the selectedindexchanged to assign the text and value to two session variables when the user changes his selection in the dropdown list, now i also have an anchor tag close to the dropdownlist, when the user changes the selection in the dropdownlist the two session variables will be initialised and then the user clicks the anchor link and on the basis of the session variables the middle_frame page will get changed..till this it is working properly...
Managing Session variables in a class
First, I am a newbee, very new and think i have gotten in trouble with this one.
I want to create a class (i thought I did until i tried a second page) that can help me manage my session variables like session("userguid") through out the session for an individual. the thought was that there is a lot of information that continues to change and using a class if i set a value, it can automatically run code to do processing. So, for example, I have the following as my class: (short view of class) The name of this file is UserSession.vb
Imports System.Data.SqlClient
Public ...
Session State in a class file
I have a class that inherits system.web.ui.page. It is a class, not a web page. In this class, I am authenticating and authorizing the user on every page.
If the user is not authorized, then then an exception is raised. I store that exception in session and transfer to an error page.
My problem is that because this is not a literal web page, that the session object can not be used up front. It says that I must enable session state in the @page directory. Is there a way to set those programatically, or is there a way that I can grab the last exception raised from the error page...
Good news for those of you who get "Unable to make the session state request to the session state server." error..
Dear all,Due to the known problem of session variables getting lost if using InProc-server during frequent changes in development, I had to choose between SQL and ASP.NET State server, so I opted for the second. Initially, all fine, but after using it for a few days, I started to get this error: Server Error in '/cv2' Application.Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accep...
getting a new session id and losing session variables
prb: I have two pages in my app - one on redirect and the other as a new window - that get a new session id from every other page in the app (they both get the same session id) and obviously the session state variables are lost and, therefore, the pages do not look like they should. All pages are within the same domain and virtual directory. 1. a redirect; session variables are lost; session id is different from the previous page; if you click the BACK button you return to the previous page and the session id is the same as before and the session variables are as they should be2. ...