Session.Add method - what if called multiple times with the same k

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wonder what is happening if you subsequently use the session.add method
with the same key, but different values.

e.g. if I do;
session.add("MyVar", "a")
session.add("MyVar", "b")

then; session("MyVar").tostring will return "b"

Is the value you are adding ("b") simply replacing the olde value ("a")
If so, should the name of the method then not be something like session.set,
because you are not actually adding anything.

Can't find anything about this in the documentation. Some explaination is
appreciated.
 
Hi,

I believe it is because of MS wants to reduce the number of
properties/methods etc.,
and It makes sense when assuming that Session is a memory area ( like a
container)
where you will add up all your values. "Set" sounds to be setting some thing
with determined manner.

Hope, this makes sense :)

Cheers!
 

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

Back
Top