Session in Classic ASP

I am working on a project in classic ASP, and I want to add, for example, some users for a temporary list, and when I submit the form, this data will be saved in DB.

I know how to work with this in asp.net, but not in classic asp.

Is it possible to create user lists, for example, and manage this in a session?

thanks!

+7
session asp-classic
source share
2 answers

yesa, you can use this or application state. one remark, you cannot store objects in it, so you need to do serialization if you want to store any complex things in it.

Session("username")="Donald Duck" Session("age")=50 

http://www.w3schools.com/ASP/asp_sessions.asp

+9
source share

OPINION

You have several options, of which the session is not the one I would recommend. Just using a posting form would be preferable only because of all the potential overhead with sessions in general. Most of them, as a rule, want to use them to store login data for a user registered on the site.

Not a classic asp, but good to know in all future endeavors with Sessions http://www.aspnet101.com/2010/10/asp-net-session-state-best-practices/

Reply http://www.w3schools.com/ASP/asp_sessions.asp

 //adding values to a session CSV //Yes I know these are not vbscript comments //but I cant use vb comments Session("someString") = "Value1,Value2,Value3" //Retrieving a value from a session Dim valsArr = Split(Session("someString"),",") //returning all content in a session object dim i For Each i in Session.Contents Response.Write(i & " ") Next
//adding values to a session CSV //Yes I know these are not vbscript comments //but I cant use vb comments Session("someString") = "Value1,Value2,Value3" //Retrieving a value from a session Dim valsArr = Split(Session("someString"),",") //returning all content in a session object dim i For Each i in Session.Contents Response.Write(i & " ") Next 
+2
source share

All Articles