24, July 2008

Storing session variable - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  Miscellaneous Languages  >  ASP & .NET
Topic: Storing session variable
« previous next »
Pages: [1] Print

Author Topic: Storing session variable  (Read 1730 times)
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: Male
Posts: 7974
40801 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

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
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: Male
Posts: 7974
40801 credits
Members referred : 3



« Reply #3 on: Nov 21, 2006, 09:13:56 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?

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?

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
1 post to be geek!
*
Posts: 49
126 credits
Members referred : 0


« Reply #4 on: Nov 21, 2006, 09:18:33 PM »

haha...clearly.  thanks!
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6280
38506 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Nov 21, 2006, 10:31:35 PM »

Or set a cookie to store the data is less safe but also less work (maybe is this the session state)

btw. Jason, its time to switch to real web applications powered by PHP Cheesy


Last blog : 4th of July Lottery from TemplateMonster.com
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 Smiley
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=4903
Tags : php mysql databases cookies Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  Miscellaneous Languages  >  ASP & .NET
Topic: Storing session variable
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Jul 24, 2008, 11:47:01 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 35.712
Total Topics: 7.376
Total Members: 3.706
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: FortuneBeach

34 Guests, 3 Users online :

11 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.