Showing posts with label posting. Show all posts
Showing posts with label posting. Show all posts

Thursday, March 29, 2012

Performance of DataBinder.Eval

Howdy All,

I was reading an older posting about the performance hit of
DataBinder.Eval.

http://groups-beta.google.com/group...02b1685ae0f63c0

Am I correct in understanding that

<%# ((DataRowView)Container.DataIt*em)["EmployeeName"] %
would have better performance than
<%# DataBinder.Eval(Container.DataIt*em, ["EmployeeName"]) %
Does anybody have comments on this or is there a better way to set the
values of the Template Column?

thanks

dblDBL:
You are correct.

I can't give you numbers, but you ARE correct.

I will say 1 more thing however. Casting DataItem to the specific item
might be faster, but it violates your tiers and makes it harder to maintain.
Your presentation shouldn't know what TYPE of data source is being bound, it
should be implementation independent. The minute you start casting
everything, you make it a realy pain in the ass to change if you start using
collections or datasets.

Sometimes the penalty is too high to pay, but in my opinion in this case,
I'd strongly suggest you use DataBinder.Eval unless you have compelling
reasons why you shoudln't in your particular case.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)

"DBLWizard" <ibflyfishin@.yahoo.com> wrote in message
news:1121106912.352713.81740@.g44g2000cwa.googlegro ups.com...
Howdy All,

I was reading an older posting about the performance hit of
DataBinder.Eval.

http://groups-beta.google.com/group...02b1685ae0f63c0

Am I correct in understanding that

<%# ((DataRowView)Container.DataIt*em)["EmployeeName"] %
would have better performance than
<%# DataBinder.Eval(Container.DataIt*em, ["EmployeeName"]) %
Does anybody have comments on this or is there a better way to set the
values of the Template Column?

thanks

dbl

Monday, March 26, 2012

Permission check for secured subfolders?

Excuse me for multiple posting because I've posted this message to
aspnet.security NG but have not got any response yet.
I'm building an ASP.NET application works in Forms Authentication mode with
custom user account database. And it shows clients a list of hyperlinks to
content pages located in some separated subfolders. This application and
content pages are entirely secured, so everyone must logon to the
application. The application pages and most of content pages are accessible
for every authenticated clients but some of content pages in some specific
subfolders are served for specific users and groups only. I'm using URL
authorization to achieve this. Everything works fine now.
Now what I'm attempting to do is, hide/remove hyperlinks to unacceptable
contents from the contents list page. To do this, I want to test client's
access right for every subfolders at server side Page_Load() function, so
that avoid client user's useless operation. I don't want to show clients the
access forbidden message any more.
How can I do it?
Help me please.
best regards,
TKHi TK,
I think you may be going about this the wrong way. What you really want to
do is design your application so that people have access to certain areas
based upon their role. You can then use User.IsInRole(<role> ) to determine
if a user should see a particular page element. You can also use
<location> elements within your web.config to limit a user's access to
certain parts of the application.
Here's a URL you may find helpful:
http://msdn.microsoft.com/library/d...-us/secmod/html
/secmod18.asp
Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
jamesche@.online.microsoft.com
This post is provided "AS-IS" with no warranties and confers no rights.
--
>From: "TK" <tkanda@.nospam.emotionalbits.com>
>Subject: Permission check for secured subfolders?
>Date: Tue, 13 Jul 2004 17:13:41 +0900
>Lines: 24
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-2022-jp"
>Content-Transfer-Encoding: 7bit
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
>Message-ID: <OXhDcHLaEHA.1656@.TK2MSFTNGP09.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>NNTP-Posting-Host: q255060.ap.plala.or.jp 220.99.255.60
>Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09
.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:246546
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>Excuse me for multiple posting because I've posted this message to
>aspnet.security NG but have not got any response yet.
>I'm building an ASP.NET application works in Forms Authentication mode with
>custom user account database. And it shows clients a list of hyperlinks to
>content pages located in some separated subfolders. This application and
>content pages are entirely secured, so everyone must logon to the
>application. The application pages and most of content pages are accessible
>for every authenticated clients but some of content pages in some specific
>subfolders are served for specific users and groups only. I'm using URL
>authorization to achieve this. Everything works fine now.
>Now what I'm attempting to do is, hide/remove hyperlinks to unacceptable
>contents from the contents list page. To do this, I want to test client's
>access right for every subfolders at server side Page_Load() function, so
>that avoid client user's useless operation. I don't want to show clients
the
>access forbidden message any more.
>How can I do it?
>Help me please.
>best regards,
>TK
>
Thank you for your help Jim!
You made my problem be clear. Yes, I agree with you I should use
User.IsInRole(<role> ) method to check user's access permission. But where I
can get the <role> definitions? Do I have to manipulate the Web.config by
myself to get the <allow><deny> configurations for every subfolders?
In my application, these secured subfolders are not only located at flat
level but also be configured as an nested tree. And the contents manager
should be able to configure neccesary security settings to every subfolders
in everywhere.
So, if a content page is located at an URL such as
http://myserver/myapp/folder1/folde...3/content.aspx, then I think I
have to manipulate Web.config files located in folder3, folder2, folder1,
myapp and machine.config all by myself.
Is thing like as above an only way for me?
Are there any classes/methods for me to make things easier?
best regards,
TK
"Jim Cheshire [MSFT]" <jamesche@.online.microsoft.com> wrote in message
news:5BKbGqOaEHA.3316@.cpmsftngxa06.phx.gbl...
> Hi TK,
> I think you may be going about this the wrong way. What you really want
to
> do is design your application so that people have access to certain areas
> based upon their role. You can then use User.IsInRole(<role> ) to
determine
> if a user should see a particular page element. You can also use
> <location> elements within your web.config to limit a user's access to
> certain parts of the application.
> Here's a URL you may find helpful:
>
http://msdn.microsoft.com/library/d...-us/secmod/html
> /secmod18.asp
> Jim Cheshire [MSFT]
> MCP+I, MCSE, MCSD, MCDBA
> Microsoft Developer Support
> jamesche@.online.microsoft.com
> This post is provided "AS-IS" with no warranties and confers no rights.
> --
>
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09
> phx.gbl
microsoft.public.dotnet.framework.aspnet:246546
with
to
accessible
specific
> the
>
TK,
You assign the roles in the user's database record or simply use the AD
roles. Doesn't matter.
As far as assigning which role has access to which resources, <location>
tags are going to be the best method.
Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
jamesche@.online.microsoft.com
This post is provided "AS-IS" with no warranties and confers no rights.
--
>From: "TK" <tkanda@.nospam.emotionalbits.com>
>References: <OXhDcHLaEHA.1656@.TK2MSFTNGP09.phx.gbl>
<5BKbGqOaEHA.3316@.cpmsftngxa06.phx.gbl>
>Subject: Re: Permission check for secured subfolders?
>Date: Wed, 14 Jul 2004 10:33:40 +0900
>Lines: 107
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Windows-1252"
>Content-Transfer-Encoding: 7bit
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
>Message-ID: <OUPUkMUaEHA.1764@.TK2MSFTNGP10.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>NNTP-Posting-Host: q255060.ap.plala.or.jp 220.99.255.60
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:246821
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>Thank you for your help Jim!
>You made my problem be clear. Yes, I agree with you I should use
>User.IsInRole(<role> ) method to check user's access permission. But where I
>can get the <role> definitions? Do I have to manipulate the Web.config by
>myself to get the <allow><deny> configurations for every subfolders?
>In my application, these secured subfolders are not only located at flat
>level but also be configured as an nested tree. And the contents manager
>should be able to configure neccesary security settings to every subfolders
>in everywhere.
>So, if a content page is located at an URL such as
>http://myserver/myapp/folder1/folde...3/content.aspx, then I think I
>have to manipulate Web.config files located in folder3, folder2, folder1,
>myapp and machine.config all by myself.
>Is thing like as above an only way for me?
>Are there any classes/methods for me to make things easier?
>best regards,
>TK
>
>"Jim Cheshire [MSFT]" <jamesche@.online.microsoft.com> wrote in message
>news:5BKbGqOaEHA.3316@.cpmsftngxa06.phx.gbl...
>to
>determine
>http://msdn.microsoft.com/library/d...n-us/secmod/htm
l
>cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP0
9
>microsoft.public.dotnet.framework.aspnet:246546
>with
>to
>accessible
>specific
client's
so
>

Saturday, March 24, 2012

Permission check for secured subfolders?

Excuse me for multiple posting because I've posted this message to
aspnet.security NG but have not got any response yet.

I'm building an ASP.NET application works in Forms Authentication mode with
custom user account database. And it shows clients a list of hyperlinks to
content pages located in some separated subfolders. This application and
content pages are entirely secured, so everyone must logon to the
application. The application pages and most of content pages are accessible
for every authenticated clients but some of content pages in some specific
subfolders are served for specific users and groups only. I'm using URL
authorization to achieve this. Everything works fine now.

Now what I'm attempting to do is, hide/remove hyperlinks to unacceptable
contents from the contents list page. To do this, I want to test client's
access right for every subfolders at server side Page_Load() function, so
that avoid client user's useless operation. I don't want to show clients the
access forbidden message any more.

How can I do it?
Help me please.

best regards,
TKHi TK,

I think you may be going about this the wrong way. What you really want to
do is design your application so that people have access to certain areas
based upon their role. You can then use User.IsInRole(<role>) to determine
if a user should see a particular page element. You can also use
<location> elements within your web.config to limit a user's access to
certain parts of the application.

Here's a URL you may find helpful:

http://msdn.microsoft.com/library/d...-us/secmod/html
/secmod18.asp

Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
jamesche@.online.microsoft.com

This post is provided "AS-IS" with no warranties and confers no rights.

-------
>From: "TK" <tkanda@.nospam.emotionalbits.com>
>Subject: Permission check for secured subfolders?
>Date: Tue, 13 Jul 2004 17:13:41 +0900
>Lines: 24
>MIME-Version: 1.0
>Content-Type: text/plain;
>charset="iso-2022-jp"
>Content-Transfer-Encoding: 7bit
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
>Message-ID: <OXhDcHLaEHA.1656@.TK2MSFTNGP09.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>NNTP-Posting-Host: q255060.ap.plala.or.jp 220.99.255.60
>Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP09
.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:246546
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>Excuse me for multiple posting because I've posted this message to
>aspnet.security NG but have not got any response yet.
>I'm building an ASP.NET application works in Forms Authentication mode with
>custom user account database. And it shows clients a list of hyperlinks to
>content pages located in some separated subfolders. This application and
>content pages are entirely secured, so everyone must logon to the
>application. The application pages and most of content pages are accessible
>for every authenticated clients but some of content pages in some specific
>subfolders are served for specific users and groups only. I'm using URL
>authorization to achieve this. Everything works fine now.
>Now what I'm attempting to do is, hide/remove hyperlinks to unacceptable
>contents from the contents list page. To do this, I want to test client's
>access right for every subfolders at server side Page_Load() function, so
>that avoid client user's useless operation. I don't want to show clients
the
>access forbidden message any more.
>How can I do it?
>Help me please.
>best regards,
>TK
Thank you for your help Jim!

You made my problem be clear. Yes, I agree with you I should use
User.IsInRole(<role>) method to check user's access permission. But where I
can get the <role> definitions? Do I have to manipulate the Web.config by
myself to get the <allow><deny> configurations for every subfolders?

In my application, these secured subfolders are not only located at flat
level but also be configured as an nested tree. And the contents manager
should be able to configure neccesary security settings to every subfolders
in everywhere.

So, if a content page is located at an URL such as
http://myserver/myapp/folder1/folde...r3/content.aspx, then I think I
have to manipulate Web.config files located in folder3, folder2, folder1,
myapp and machine.config all by myself.

Is thing like as above an only way for me?
Are there any classes/methods for me to make things easier?

best regards,
TK

"Jim Cheshire [MSFT]" <jamesche@.online.microsoft.com> wrote in message
news:5BKbGqOaEHA.3316@.cpmsftngxa06.phx.gbl...
> Hi TK,
> I think you may be going about this the wrong way. What you really want
to
> do is design your application so that people have access to certain areas
> based upon their role. You can then use User.IsInRole(<role>) to
determine
> if a user should see a particular page element. You can also use
> <location> elements within your web.config to limit a user's access to
> certain parts of the application.
> Here's a URL you may find helpful:
>
http://msdn.microsoft.com/library/d...-us/secmod/html
> /secmod18.asp
> Jim Cheshire [MSFT]
> MCP+I, MCSE, MCSD, MCDBA
> Microsoft Developer Support
> jamesche@.online.microsoft.com
> This post is provided "AS-IS" with no warranties and confers no rights.
> -------
> >From: "TK" <tkanda@.nospam.emotionalbits.com>
> >Subject: Permission check for secured subfolders?
> >Date: Tue, 13 Jul 2004 17:13:41 +0900
> >Lines: 24
> >MIME-Version: 1.0
> >Content-Type: text/plain;
> > charset="iso-2022-jp"
> >Content-Transfer-Encoding: 7bit
> >X-Priority: 3
> >X-MSMail-Priority: Normal
> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
> >Message-ID: <OXhDcHLaEHA.1656@.TK2MSFTNGP09.phx.gbl>
> >Newsgroups: microsoft.public.dotnet.framework.aspnet
> >NNTP-Posting-Host: q255060.ap.plala.or.jp 220.99.255.60
> >Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP09
> phx.gbl
> >Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet:246546
> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> >Excuse me for multiple posting because I've posted this message to
> >aspnet.security NG but have not got any response yet.
> >I'm building an ASP.NET application works in Forms Authentication mode
with
> >custom user account database. And it shows clients a list of hyperlinks
to
> >content pages located in some separated subfolders. This application and
> >content pages are entirely secured, so everyone must logon to the
> >application. The application pages and most of content pages are
accessible
> >for every authenticated clients but some of content pages in some
specific
> >subfolders are served for specific users and groups only. I'm using URL
> >authorization to achieve this. Everything works fine now.
> >Now what I'm attempting to do is, hide/remove hyperlinks to unacceptable
> >contents from the contents list page. To do this, I want to test client's
> >access right for every subfolders at server side Page_Load() function, so
> >that avoid client user's useless operation. I don't want to show clients
> the
> >access forbidden message any more.
> >How can I do it?
> >Help me please.
> >best regards,
> >TK
TK,

You assign the roles in the user's database record or simply use the AD
roles. Doesn't matter.

As far as assigning which role has access to which resources, <location>
tags are going to be the best method.

Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
jamesche@.online.microsoft.com

This post is provided "AS-IS" with no warranties and confers no rights.

-------
>From: "TK" <tkanda@.nospam.emotionalbits.com>
>References: <OXhDcHLaEHA.1656@.TK2MSFTNGP09.phx.gbl>
<5BKbGqOaEHA.3316@.cpmsftngxa06.phx.gbl>
>Subject: Re: Permission check for secured subfolders?
>Date: Wed, 14 Jul 2004 10:33:40 +0900
>Lines: 107
>MIME-Version: 1.0
>Content-Type: text/plain;
>charset="Windows-1252"
>Content-Transfer-Encoding: 7bit
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
>Message-ID: <OUPUkMUaEHA.1764@.TK2MSFTNGP10.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>NNTP-Posting-Host: q255060.ap.plala.or.jp 220.99.255.60
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:246821
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>Thank you for your help Jim!
>You made my problem be clear. Yes, I agree with you I should use
>User.IsInRole(<role>) method to check user's access permission. But where I
>can get the <role> definitions? Do I have to manipulate the Web.config by
>myself to get the <allow><deny> configurations for every subfolders?
>In my application, these secured subfolders are not only located at flat
>level but also be configured as an nested tree. And the contents manager
>should be able to configure neccesary security settings to every subfolders
>in everywhere.
>So, if a content page is located at an URL such as
>http://myserver/myapp/folder1/folde...r3/content.aspx, then I think I
>have to manipulate Web.config files located in folder3, folder2, folder1,
>myapp and machine.config all by myself.
>Is thing like as above an only way for me?
>Are there any classes/methods for me to make things easier?
>best regards,
>TK
>
>"Jim Cheshire [MSFT]" <jamesche@.online.microsoft.com> wrote in message
>news:5BKbGqOaEHA.3316@.cpmsftngxa06.phx.gbl...
>> Hi TK,
>>
>> I think you may be going about this the wrong way. What you really want
>to
>> do is design your application so that people have access to certain areas
>> based upon their role. You can then use User.IsInRole(<role>) to
>determine
>> if a user should see a particular page element. You can also use
>> <location> elements within your web.config to limit a user's access to
>> certain parts of the application.
>>
>> Here's a URL you may find helpful:
>>
>>
>http://msdn.microsoft.com/library/d...n-us/secmod/htm
l
>> /secmod18.asp
>>
>> Jim Cheshire [MSFT]
>> MCP+I, MCSE, MCSD, MCDBA
>> Microsoft Developer Support
>> jamesche@.online.microsoft.com
>>
>> This post is provided "AS-IS" with no warranties and confers no rights.
>>
>> -------
>> >From: "TK" <tkanda@.nospam.emotionalbits.com>
>> >Subject: Permission check for secured subfolders?
>> >Date: Tue, 13 Jul 2004 17:13:41 +0900
>> >Lines: 24
>> >MIME-Version: 1.0
>> >Content-Type: text/plain;
>> > charset="iso-2022-jp"
>> >Content-Transfer-Encoding: 7bit
>> >X-Priority: 3
>> >X-MSMail-Priority: Normal
>> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
>> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
>> >Message-ID: <OXhDcHLaEHA.1656@.TK2MSFTNGP09.phx.gbl>
>> >Newsgroups: microsoft.public.dotnet.framework.aspnet
>> >NNTP-Posting-Host: q255060.ap.plala.or.jp 220.99.255.60
>> >Path:
>>
>cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP0
9
>> phx.gbl
>> >Xref: cpmsftngxa06.phx.gbl
>microsoft.public.dotnet.framework.aspnet:246546
>> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>>> >Excuse me for multiple posting because I've posted this message to
>> >aspnet.security NG but have not got any response yet.
>>> >I'm building an ASP.NET application works in Forms Authentication mode
>with
>> >custom user account database. And it shows clients a list of hyperlinks
>to
>> >content pages located in some separated subfolders. This application and
>> >content pages are entirely secured, so everyone must logon to the
>> >application. The application pages and most of content pages are
>accessible
>> >for every authenticated clients but some of content pages in some
>specific
>> >subfolders are served for specific users and groups only. I'm using URL
>> >authorization to achieve this. Everything works fine now.
>>> >Now what I'm attempting to do is, hide/remove hyperlinks to unacceptable
>> >contents from the contents list page. To do this, I want to test
client's
>> >access right for every subfolders at server side Page_Load() function,
so
>> >that avoid client user's useless operation. I don't want to show clients
>> the
>> >access forbidden message any more.
>>> >How can I do it?
>> >Help me please.
>>> >best regards,
>> >TK
>>>>

Friday, March 16, 2012

Persistent Cookies

Hello everyone,

I didn't get any response in "Security" forum hence posting here again.

I am having problem with persistent cookies. Even after setting
"CreatePersistentCookie" to true in "FormsAuthentication.SetAuthCookie" I'm
being logged out after the specifed timeout provided in "forms"
element of web.config.

I read somewhere that lifetime of persistent cookies depend on the timeout
attribute on the forms authentcation node. If I have to enter a timeout of
days/weeks then it doesnt really make sense to make my cookie persist in
this fashion, that defies the purpose of persistent cookies.

Any insights welcome
Thanks
SanchitaYou miss the purpose of persistant cookies. They are not used for session
management, they are used for authentication.

A persistent cookie is designed to allow the user to access a secured site
without having to log in again when he hits the site the second time. It
persists the authentication on the client side so it is sent with the
header. The system then automatically logs him in.

Session timeout is a part of your application. While the cookie can "re-log
on" the user if he times out, it cannot change the timeout behavior on the
server just because the user has a cookie.

For the record, you should NOT increase timeout to days. That defeats the
purpose of session management. What you can do is kick the user back to the
start page and abandon session, forcing the timeout. You then provide a link
on the timeout page. This can be a dynamic link back to where he was
working, if you desire. The user will then be logged back in, as the cookie
is there.

This may not be what you envision and make you think you want to increase
session time until the year 2010. Here is why. The session timeout is how
long the server keeps objects in session, meaning in memory on the server.
You set a really long timeout, say two weeks out. That session is now open
for two weeks. User's computer crashes and he opens the browser and hits
your site. You now have 2 two-week sessions for one user. After some work,
the user shuts down and then opens the browser again and hits the site. You
now have 3 two-week sessions for one user. This can go on until you use all
of the memory on the server with just a couple of users.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
"sanchita" <sanchita@.fareportal.comwrote in message
news:OSj$Xv%23bHHA.1244@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Hello everyone,
>
I didn't get any response in "Security" forum hence posting here again.
>
I am having problem with persistent cookies. Even after setting
"CreatePersistentCookie" to true in "FormsAuthentication.SetAuthCookie"
I'm
being logged out after the specifed timeout provided in "forms"
element of web.config.
>
I read somewhere that lifetime of persistent cookies depend on the timeout
attribute on the forms authentcation node. If I have to enter a timeout of
days/weeks then it doesnt really make sense to make my cookie persist in
this fashion, that defies the purpose of persistent cookies.
>
Any insights welcome
Thanks
Sanchita
>


Hi sanchita,

This has been a change in ASP.NET 2.0. If you don't specify
CreatePersistantCookie the cookie times out. If you do, then the timeout
value is what determines the cookie timeout even if you create a persistent
cookie.

This differs from ASP.NET 1.x which created a cookie with a long expiration
date - in 2.0 the expiration date is based on the timeout.

IOW, you need to set thte timeout value to a large number if you want a true
persistent cookie.

+++ Rick --

--

Rick Strahl
West Wind Technologies
www.west-wind.com/weblog
"sanchita" <sanchita@.fareportal.comwrote in message
news:OSj$Xv%23bHHA.1244@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

Hello everyone,
>
I didn't get any response in "Security" forum hence posting here again.
>
I am having problem with persistent cookies. Even after setting
"CreatePersistentCookie" to true in "FormsAuthentication.SetAuthCookie"
I'm
being logged out after the specifed timeout provided in "forms"
element of web.config.
>
I read somewhere that lifetime of persistent cookies depend on the timeout
attribute on the forms authentcation node. If I have to enter a timeout of
days/weeks then it doesnt really make sense to make my cookie persist in
this fashion, that defies the purpose of persistent cookies.
>
Any insights welcome
Thanks
Sanchita
>


Yes I know that they arent used for session management. Since persistent
cookies arent working the way they were in asp.net 1.1, wherein what used to
happen was the framework itself had set the timeout for a persistent cookie
for days, we didn't have a control over it. However in asp.net 2.0 we can
set the timeout for persistent cookies in our configuration. But the funny
thing is no matter if you want the cookie to be persistent or
non-persistent, both will acquire this timeout value. So it leaves me no
choice but to set one. Scott Gutherie from Microsoft also verifed on this to
us.

Although I'm working out my options and not just setting the timeout value
to a huge number. For the record I'm using Dotnetnuke 2.4 and facing this
problem since I shifted to asp.net 2.0. However my Team leader tells me that
in DNN 4.0 persistent cookies work fine despite the default timeout.

Thanks
Sanchita
"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@.comcast.netNoSpamMwrote in
message news:ADE74ED7-274F-4938-A1BC-50C9A3C38779@.microsoft.com...

Quote:

Originally Posted by

You miss the purpose of persistant cookies. They are not used for session
management, they are used for authentication.
>
A persistent cookie is designed to allow the user to access a secured site
without having to log in again when he hits the site the second time. It
persists the authentication on the client side so it is sent with the
header. The system then automatically logs him in.
>
Session timeout is a part of your application. While the cookie can
"re-log on" the user if he times out, it cannot change the timeout
behavior on the server just because the user has a cookie.
>
For the record, you should NOT increase timeout to days. That defeats the
purpose of session management. What you can do is kick the user back to
the start page and abandon session, forcing the timeout. You then provide
a link on the timeout page. This can be a dynamic link back to where he
was working, if you desire. The user will then be logged back in, as the
cookie is there.
>
This may not be what you envision and make you think you want to increase
session time until the year 2010. Here is why. The session timeout is how
long the server keeps objects in session, meaning in memory on the server.
You set a really long timeout, say two weeks out. That session is now open
for two weeks. User's computer crashes and he opens the browser and hits
your site. You now have 2 two-week sessions for one user. After some work,
the user shuts down and then opens the browser again and hits the site.
You now have 3 two-week sessions for one user. This can go on until you
use all of the memory on the server with just a couple of users.
>
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
>
*********************************************
Think outside the box!
*********************************************
"sanchita" <sanchita@.fareportal.comwrote in message
news:OSj$Xv%23bHHA.1244@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

>Hello everyone,
>>
>I didn't get any response in "Security" forum hence posting here again.
>>
>I am having problem with persistent cookies. Even after setting
>"CreatePersistentCookie" to true in "FormsAuthentication.SetAuthCookie"
>I'm
>being logged out after the specifed timeout provided in "forms"
>element of web.config.
>>
>I read somewhere that lifetime of persistent cookies depend on the
>timeout
>attribute on the forms authentcation node. If I have to enter a timeout
>of
>days/weeks then it doesnt really make sense to make my cookie persist in
>this fashion, that defies the purpose of persistent cookies.
>>
>Any insights welcome
>Thanks
>Sanchita
>>


>

Persistent Cookies

Hello everyone,
I didn't get any response in "Security" forum hence posting here again.
I am having problem with persistent cookies. Even after setting
"CreatePersistentCookie" to true in "FormsAuthentication.SetAuthCookie" I'm
being logged out after the specifed timeout provided in "forms"
element of web.config.
I read somewhere that lifetime of persistent cookies depend on the timeout
attribute on the forms authentcation node. If I have to enter a timeout of
days/ws then it doesnt really make sense to make my cookie persist in
this fashion, that defies the purpose of persistent cookies.
Any insights welcome
Thanks
SanchitaYou miss the purpose of persistant cookies. They are not used for session
management, they are used for authentication.
A persistent cookie is designed to allow the user to access a secured site
without having to log in again when he hits the site the second time. It
persists the authentication on the client side so it is sent with the
header. The system then automatically logs him in.
Session timeout is a part of your application. While the cookie can "re-log
on" the user if he times out, it cannot change the timeout behavior on the
server just because the user has a cookie.
For the record, you should NOT increase timeout to days. That defeats the
purpose of session management. What you can do is kick the user back to the
start page and abandon session, forcing the timeout. You then provide a link
on the timeout page. This can be a dynamic link back to where he was
working, if you desire. The user will then be logged back in, as the cookie
is there.
This may not be what you envision and make you think you want to increase
session time until the year 2010. Here is why. The session timeout is how
long the server keeps objects in session, meaning in memory on the server.
You set a really long timeout, say two ws out. That session is now open
for two ws. User's computer crashes and he opens the browser and hits
your site. You now have 2 two-w sessions for one user. After some work,
the user shuts down and then opens the browser again and hits the site. You
now have 3 two-w sessions for one user. This can go on until you use all
of the memory on the server with just a couple of users.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
****************************************
*****
Think outside the box!
****************************************
*****
"sanchita" <sanchita@.fareportal.com> wrote in message
news:OSj$Xv%23bHHA.1244@.TK2MSFTNGP04.phx.gbl...
> Hello everyone,
> I didn't get any response in "Security" forum hence posting here again.
> I am having problem with persistent cookies. Even after setting
> "CreatePersistentCookie" to true in "FormsAuthentication.SetAuthCookie"
> I'm
> being logged out after the specifed timeout provided in "forms"
> element of web.config.
> I read somewhere that lifetime of persistent cookies depend on the timeout
> attribute on the forms authentcation node. If I have to enter a timeout of
> days/ws then it doesnt really make sense to make my cookie persist in
> this fashion, that defies the purpose of persistent cookies.
> Any insights welcome
> Thanks
> Sanchita
>
Hi sanchita,
This has been a change in ASP.NET 2.0. If you don't specify
CreatePersistantCookie the cookie times out. If you do, then the timeout
value is what determines the cookie timeout even if you create a persistent
cookie.
This differs from ASP.NET 1.x which created a cookie with a long expiration
date - in 2.0 the expiration date is based on the timeout.
IOW, you need to set thte timeout value to a large number if you want a true
persistent cookie.
+++ Rick --
Rick Strahl
West Wind Technologies
www.west-wind.com/weblog
"sanchita" <sanchita@.fareportal.com> wrote in message
news:OSj$Xv%23bHHA.1244@.TK2MSFTNGP04.phx.gbl...
> Hello everyone,
> I didn't get any response in "Security" forum hence posting here again.
> I am having problem with persistent cookies. Even after setting
> "CreatePersistentCookie" to true in "FormsAuthentication.SetAuthCookie"
> I'm
> being logged out after the specifed timeout provided in "forms"
> element of web.config.
> I read somewhere that lifetime of persistent cookies depend on the timeout
> attribute on the forms authentcation node. If I have to enter a timeout of
> days/ws then it doesnt really make sense to make my cookie persist in
> this fashion, that defies the purpose of persistent cookies.
> Any insights welcome
> Thanks
> Sanchita
>
Yes I know that they arent used for session management. Since persistent
cookies arent working the way they were in asp.net 1.1, wherein what used to
happen was the framework itself had set the timeout for a persistent cookie
for days, we didn't have a control over it. However in asp.net 2.0 we can
set the timeout for persistent cookies in our configuration. But the funny
thing is no matter if you want the cookie to be persistent or
non-persistent, both will acquire this timeout value. So it leaves me no
choice but to set one. Scott Gutherie from Microsoft also verifed on this to
us.
Although I'm working out my options and not just setting the timeout value
to a huge number. For the record I'm using Dotnetnuke 2.4 and facing this
problem since I shifted to asp.net 2.0. However my Team leader tells me that
in DNN 4.0 persistent cookies work fine despite the default timeout.
Thanks
Sanchita
"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@.comcast.netNoSpamM> wrote in
message news:ADE74ED7-274F-4938-A1BC-50C9A3C38779@.microsoft.com...
> You miss the purpose of persistant cookies. They are not used for session
> management, they are used for authentication.
> A persistent cookie is designed to allow the user to access a secured site
> without having to log in again when he hits the site the second time. It
> persists the authentication on the client side so it is sent with the
> header. The system then automatically logs him in.
> Session timeout is a part of your application. While the cookie can
> "re-log on" the user if he times out, it cannot change the timeout
> behavior on the server just because the user has a cookie.
> For the record, you should NOT increase timeout to days. That defeats the
> purpose of session management. What you can do is kick the user back to
> the start page and abandon session, forcing the timeout. You then provide
> a link on the timeout page. This can be a dynamic link back to where he
> was working, if you desire. The user will then be logged back in, as the
> cookie is there.
> This may not be what you envision and make you think you want to increase
> session time until the year 2010. Here is why. The session timeout is how
> long the server keeps objects in session, meaning in memory on the server.
> You set a really long timeout, say two ws out. That session is now open
> for two ws. User's computer crashes and he opens the browser and hits
> your site. You now have 2 two-w sessions for one user. After some work,
> the user shuts down and then opens the browser again and hits the site.
> You now have 3 two-w sessions for one user. This can go on until you
> use all of the memory on the server with just a couple of users.
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> ****************************************
*****
> Think outside the box!
> ****************************************
*****
> "sanchita" <sanchita@.fareportal.com> wrote in message
> news:OSj$Xv%23bHHA.1244@.TK2MSFTNGP04.phx.gbl...
>