Using Profile for session state

M

milop

Hello.

Not wanting to have to cast every object that needs to be stored in session
state, I am thinking of using Profiles introduced with ASP.Net 2.0.

All of my objects are serializable so that's not an issue.

My main concern is persistence: I don't need to persist this information
beyond the session. So perhaps in the Session_End event in the Global.aspx
file can take care of deleting it.

Has anyone utilized Profiles to achieve strong-typed session state? What are
the pitfalls?

Any and all comments are much appreciated.

Thanks in advance,

Mike
 
M

milop

Hi, Patrice.

I appreciate the suggestion, and did see that code, but I'm not crazy about
it. Profiles do all this work behind the scenes, but I am concerned about
side effects (things I haven't thought about yet) that may exist when using
Profiles as a session state mechanism.

Thanks again,

Mike
 
B

bruce barker

there is nothing wrong with this approach. you should turn session off, as
you don't need the resource.

the only downside is security, but no different than non-expiring sessions.
just take care with privacy data.


-- bruce (sqlwork.com)
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top