web config file problem

  • Thread starter Thread starter naija naija
  • Start date Start date
N

naija naija

Hello eveyone,
I have a web config like this below:-
<location path="finance.aspx">
<system.web>
<authorization>
<allow users="?"/>
<deny users="?"
roles="Security_Group"/>
</authorization>
<identity impersonate="true"/>
</system.web>
</location>

I have a page finance.aspx which is on the location path above can i
construct it like that or i can only DEFINE FOLDERS ONLY.
For example i would like only certain security groups to be
authenticated to that page if they aren't in the Security group they
shoud be redirected and denied.

My other Question is regarding:-
<sessionState timeout="5"/>
i set timeout to 5 but it isn't working how does this work I WANT MY
PAGE TO EXPIRE after "5" minutes.
How can i do that?
Any ideas are welcome.
Thanks
 
naija said:
Hello eveyone,
I have a web config like this below:-
<location path="finance.aspx">
<system.web>
<authorization>
<allow users="?"/>
<deny users="?"

That doesn't make sense. said:
roles="Security_Group"/>
</authorization>
<identity impersonate="true"/>
</system.web>
</location>

I have a page finance.aspx which is on the location path above can i
construct it like that or i can only DEFINE FOLDERS ONLY.
For example i would like only certain security groups to be
authenticated to that page if they aren't in the Security group they
shoud be redirected and denied.

Yes said:
My other Question is regarding:-
<sessionState timeout="5"/>
i set timeout to 5 but it isn't working how does this work I WANT MY
PAGE TO EXPIRE after "5" minutes.
How can i do that?

Page expirations and session timeouts are two completly different things.
Page expiration is a caching option.

TimeSpan expiration = new TimeSpan(0, 5, 0);
Response.Cache.SetMaxAge(expiration); // for HTTP 1.1 clients
Response.Cache.SetExpires(DateTime.Now.Add(expiration)); // for HTTP 1.0
clients

/* If you have Response.CacheControl set to "public", apply this one as
well:
Response.Cache.SetProxyMaxAge(expiration);
*/

Cheers,
 
Yes, you can define particular files, not only directories using <location>
element

look here for more info :

http://msdn.microsoft.com/library/d.../en-us/cpgenref/html/gngrflocationelement.asp

as for the second question .. hmm .. its strange ... maybe try to use
standard <sessionState> entry created by VS.NET ... :

<sessionState
mode="InProc"

stateConnectionString="tcpip=127.0.0.1:42424"

sqlConnectionString="data source=127.0.0.1;user id=sa;password="

cookieless="false"

timeout="5"

/>


HTH

btw, long time since last mail .. :) .. how are you doing .. ? .. let me
hear from you .. :)

Konrad
 
To allow access for a specific role like Security_Group:

<allow roles="Security_Group"/>

To deny access to all users:

<deny users="*"/>

To deny access to anonymous users:

<deny users="?"/>

Your web.config file could look like:

<authorization>
<allow roles="Security_Group"/>
<deny users="*"/>
</authorization>
 
Hi Konrad,
How are you doing ?
Hope all well.
Lets be intouch!
Patrick
 
what i need i think its a session timeouts.
Which i'm using like:-
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>

I want my page to be active for like 20mins and after that redirected to
a page to inform the users that the session is over .
Thanks
 
Back
Top