1 post to be geek!
Posts: 49
126 credits Members referred : 0
« on: Nov 21, 2006, 09:02:03 PM »
Question:
Currently in some of my sites, i'm using a session variable for various things. A client wants the ability to save a session state and then reload it later. Clearly I can do this by saving it in a database, but i was wondering, what kind of variable is a session state variable? is it text? can i just pull it out of the db and load it back in as a session variable and have it pull the exact state back up?
thanks guys.
Jason
edit: i'm using asp.net and vb.net and a mysql server
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 7822
39867 credits Members referred : 3
« Reply #1 on: Nov 21, 2006, 09:05:08 PM »
I think the correct answer is what you say (text)
I have no experience from vb in sites (I use to code vb for applications), but anyway in the database you will propably need a text field
1 post to be geek!
Posts: 49
126 credits Members referred : 0
« Reply #2 on: Nov 21, 2006, 09:07:45 PM »
so if someone wanted to save the state of a form, i just save the session variable in a text field in a database and then call it up later and load it into the session variable when they want to reload their form? is it really that easy?
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 7822
39867 credits Members referred : 3
so if someone wanted to save the state of a form, i just save the session variable in a text field in a database and then call it up later and load it into the session variable when they want to reload their form? is it really that easy?
Yeah. But when you have to store more values(eg. an array), then you should serialize the data. I don't know how to do that in vb so you will have to search for that.
The only thing that you should worry when you are inserting in the database is to be sure that there are no ' in your data, but I guess you allready know that, right?
1 post to be geek!
Posts: 49
126 credits Members referred : 0
« Reply #6 on: Nov 21, 2006, 10:34:15 PM »
haha...yeah, when i'm ready to use a poorly-architected procedure-based language, i'll be sure to have you come teach me PHP. for now i'll stick with OOP and .NET. thanks
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=4903