Home > ASP Development > Are Session Structures possible?

Are Session Structures possible?



If anyone has used ColdFusion, they know that you can have different structures for session variables. For Instance:



SESSION.User.Name = John

SESSION.User.Age = 20

SESSION.User.Sex = Male



or



SESSION.Date.Day = Friday

SESSION.Date.Month = August

SESSION.Date.Year = 2005



So SESSION.User and SESSION.Date are individual collections of Session variables. So say for instance, you want to clear all the 'User' Session variables in a single command, you can do just that and not effect the 'Date' values.



My question is simple. Does ASP have a similar way of doing this? Because I am converting applications from CFM to ASP and I want to clear a SESSION.Validation collection once the data is ok. However, I want to leave the rest of the Session variables intact. I could always just clear each variable individually but that isn't good coding since there are 15 SESSION.Validation variables.



Thanks!

    
Guest


ASP sessions don't work the same.



The only way to do that is to create an object, but it won't behave the same as session variables.



sorry!

Was this answer helpful ? Yes No   
Guest


Could you not use a scripting.dictionary and store the it in a session?

Was this answer helpful ? Yes No   
Guest


you could create a session like:



SESSION("user") = "John,20,Male"



then split it as an array when u need to

Was this answer helpful ? Yes No   
Guest


That's what I figured. I didn't think they worked the same because I've never used them like that.



See I also thought it using the Session("Validation") = "John,20,Male" but because I won't be displaying the results sequentially, an array would be too complicated.



But nevertheless, there's always just storing them as:



Session("valid_name")

Session("valid_age")

Session("valid_sex")



Thanks guys or gals!

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved