session variables
-
I have a question about using session variables since this is the first C# 2010 web form app that I am running. Right now I am passing 3 session variables between 2 web pages in the web application that I setup. This is a data entry application where some information is entered on page 1 and the rest of the information is entered on page 2. When the user has finished entering the information for the first customer. Now the user will be ready to setup information for the second user. From what I have seen on the internet session variables last up to 20 minutes. Thus I basically do not want the information saved from customer 1 to be entered into the database file for customer 2 by using session variables. Thus to prevent this from occuring, I am coding the following before the user clicks the button to enter data for the next customer:
Session.Remove("var1");
Session.Remove("var2");
Session.Remove("var3");
Response.Redirect("~/page1.aspx");
Can you tell me if this is the best method for clearing out session variables and/or if there is a better process you would recommend? Can you tell me and/or point me to a reference that will explain your answer to me?
-
I have a question about using session variables since this is the first C# 2010 web form app that I am running. Right now I am passing 3 session variables between 2 web pages in the web application that I setup. This is a data entry application where some information is entered on page 1 and the rest of the information is entered on page 2. When the user has finished entering the information for the first customer. Now the user will be ready to setup information for the second user. From what I have seen on the internet session variables last up to 20 minutes. Thus I basically do not want the information saved from customer 1 to be entered into the database file for customer 2 by using session variables. Thus to prevent this from occuring, I am coding the following before the user clicks the button to enter data for the next customer:
Session.Remove("var1");
Session.Remove("var2");
Session.Remove("var3");
Response.Redirect("~/page1.aspx");
Can you tell me if this is the best method for clearing out session variables and/or if there is a better process you would recommend? Can you tell me and/or point me to a reference that will explain your answer to me?
-
I have a question about using session variables since this is the first C# 2010 web form app that I am running. Right now I am passing 3 session variables between 2 web pages in the web application that I setup. This is a data entry application where some information is entered on page 1 and the rest of the information is entered on page 2. When the user has finished entering the information for the first customer. Now the user will be ready to setup information for the second user. From what I have seen on the internet session variables last up to 20 minutes. Thus I basically do not want the information saved from customer 1 to be entered into the database file for customer 2 by using session variables. Thus to prevent this from occuring, I am coding the following before the user clicks the button to enter data for the next customer:
Session.Remove("var1");
Session.Remove("var2");
Session.Remove("var3");
Response.Redirect("~/page1.aspx");
Can you tell me if this is the best method for clearing out session variables and/or if there is a better process you would recommend? Can you tell me and/or point me to a reference that will explain your answer to me?
Looking into the above description, i could make 2 things. 1. you have some session variables that you are using for custom logic. now you want to use
session["var1"]
for filling customer1 information. 2. you might have some session variables that are required for maintaining user sessions. (probably) and perhaps with the same user ID you will have to use the same session variables with separate set of data.Session.Remove("var1");
for all the variables should work once you save the data into database. but in case you dont have the requirement mentioned in #2 point i.e. maintaining user session then instead of clearing the variables one by one you can simply do asession.Abandon
too. in short, if you are not using sessions to track the login status then you can usesession.abandon
too.Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.
-
I have a question about using session variables since this is the first C# 2010 web form app that I am running. Right now I am passing 3 session variables between 2 web pages in the web application that I setup. This is a data entry application where some information is entered on page 1 and the rest of the information is entered on page 2. When the user has finished entering the information for the first customer. Now the user will be ready to setup information for the second user. From what I have seen on the internet session variables last up to 20 minutes. Thus I basically do not want the information saved from customer 1 to be entered into the database file for customer 2 by using session variables. Thus to prevent this from occuring, I am coding the following before the user clicks the button to enter data for the next customer:
Session.Remove("var1");
Session.Remove("var2");
Session.Remove("var3");
Response.Redirect("~/page1.aspx");
Can you tell me if this is the best method for clearing out session variables and/or if there is a better process you would recommend? Can you tell me and/or point me to a reference that will explain your answer to me?
-
I have a question about using session variables since this is the first C# 2010 web form app that I am running. Right now I am passing 3 session variables between 2 web pages in the web application that I setup. This is a data entry application where some information is entered on page 1 and the rest of the information is entered on page 2. When the user has finished entering the information for the first customer. Now the user will be ready to setup information for the second user. From what I have seen on the internet session variables last up to 20 minutes. Thus I basically do not want the information saved from customer 1 to be entered into the database file for customer 2 by using session variables. Thus to prevent this from occuring, I am coding the following before the user clicks the button to enter data for the next customer:
Session.Remove("var1");
Session.Remove("var2");
Session.Remove("var3");
Response.Redirect("~/page1.aspx");
Can you tell me if this is the best method for clearing out session variables and/or if there is a better process you would recommend? Can you tell me and/or point me to a reference that will explain your answer to me?