Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Using Profile for session state

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
milop - 20 Mar 2008 12:17 GMT
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
Patrice - 20 Mar 2008 13:32 GMT
You could also just create your own class that would expose session
variables in a strongly typed manner.

Try for example :
http://www.codeproject.com/KB/aspnet/typedsessionstate.aspx

--
Patrice

> Hello.
>
[quoted text clipped - 16 lines]
>
> Mike
milop - 20 Mar 2008 14:43 GMT
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

> You could also just create your own class that would expose session
> variables in a strongly typed manner.
[quoted text clipped - 25 lines]
>>
>> Mike
bruce barker - 20 Mar 2008 15:54 GMT
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)

> Hello.
>
[quoted text clipped - 15 lines]
>
> Mike

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.