p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 (http://p2p.wrox.com/forumdisplay.php?f=389)
-   -   membership question again (http://p2p.wrox.com/showthread.php?t=78131)

barakros February 8th, 2010 01:44 PM

membership question again
Hi Imar
Sorry to bug you again with this...
I was thinking about the needs I have in my web and I don’t need roles and profiles
All I need is a simple way to identify users against my db and if they authenticated they can see all the pages and so…

Can I use session (Inproc) for this? Can I simply save the user id in a session variable and use it in the application to deny or allow to see pages?
Is it risky? What problems can it cause me?


Imar February 8th, 2010 02:03 PM

Yes, you can do it, and no it's probably not risky.

But why go through all the trouble of hand coding this yourself if Forms Authentication and URL Authorization can handle all this for you automatically?

FYI: Forms Authentication != Membership. Forms Authentication is used under the hood but you you can use it yourself as well.



barakros February 15th, 2010 10:53 AM

thanks - I used Forms Authentication
and it really make things easier once I understand it.

I have 2 more questions:
I created my own Membership provider and profile provider (inherits from the ProfileProvider and MembershipProvider) so they do what I need and it work great on my developing computer.
1. Do I need to do something special when I make a release version?
2. About profile - I did not understand from the book if for each call for profile:

(in the way you described in the book - not my implementation of course) is actually asking the DB for the information or does it get the info from the memory or a cookie?
Just wanted to know the cost of using it.

Thanks again

Imar February 15th, 2010 12:13 PM

Hi Barak,

I1) No, just make a release build, not a debug build to optimize.You may need to sign it if you want to store it in the Global Assembly Cache.

2) Take another look at the Profile and Personalization chapter. It explains how the data is stored in the database.



Imar February 15th, 2010 12:22 PM

Just realized the question was maybe about accessing the individual properties? (It's not a very clear question). If so, then no, there's no performance hit. The entire profile is kept in memory during the request.



All times are GMT -4. The time now is 11:21 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.