One comment about the implementation of Session

A

antonyliu2002

I think it is a bad idea to implement session as a bag of string pairs.
That is, it is not a good idea to force both a key and its value to be
of type String.

It has no problem for most web controls. For example, for TextBox(es),
we can have the following in the session bag:

"txtFirstName": "John"
"txtLastName": "Doe"

But, the current session implementation is not handy when we have to
store ListItem(s) of a multiple ListBox.

For example, if I have on my web this multi-select ListBox (whose ID is
lstbxFood):

Select your favorite food:

Hamberger
Pizza
Icecream
French Fries
Yogurt

And suppose, a user selects the first 3 items: Hamberger, Pizza and
Icecream.

Then, we have a little problem storing in the session all 3 selected
items for the key "lstbxFood".

So, it would be nice if the value of a key in the session can be some
kind of container which can hold multiple objects.

What do you think?
 
P

Patrice

This is actually already what your suggested (the value is an object, not a
string).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,141
Messages
2,570,814
Members
47,359
Latest member
Claim Bitcoin Earnings. $

Latest Threads

Top