Home All Groups Group Topic Archive Search About
Author
8 Jul 2009 5:42 PM
ton
Hi,

when the sessionstate timeouts, I want to redirect to a logon page. The
problem is that because there are a lot of controls where the user can push
on I have to check the expreid sessionstate for each procedure. In the page
load event I allready used the

Response.Redirect("logon.aspx", False)

but (code behind of) the menu which was clicked by the user will executed.
Is there a way to avoid checking this for every possible function the user
is calling?

Ton

Author
9 Jul 2009 6:03 AM
Joy
Hi,

Normally if you are using Forms Authentication, users will be re-directed to
Login page once Session expires.

Another way is to use META Tag. But i will recommend using Forms
Authentication.

Please also take a look at the following discussion:
http://p2p.wrox.com/asp-net-1-1/28177-session-timeout-redirect-global-asax.html

Let me know if it helped.

regards,
Joy

Show quoteHide quote
"ton" wrote:

> Hi,
>
> when the sessionstate timeouts, I want to redirect to a logon page. The
> problem is that because there are a lot of controls where the user can push
> on I have to check the expreid sessionstate for each procedure. In the page
> load event I allready used the
>
> Response.Redirect("logon.aspx", False)
>
> but (code behind of) the menu which was clicked by the user will executed.
> Is there a way to avoid checking this for every possible function the user
> is calling?
>
> Ton
>
>
Are all your drivers up to date? click for free checkup

Author
9 Jul 2009 1:59 PM
ton
Hi,

I'm now using

        If Session("informatie") & "" = "" Then 'this checks whter the
sessionvar is filled
            Response.Redirect("login.aspx")  '                         so
not Response.Redirect("logon.aspx", False)
        End If

I've put this instruction in my Page_Init function (and also in my
page_load, but what ever I choose, the code stops excuting and the
login.aspx is loaded. So it is solved..

I'did read the discussion you showed me, but could figure out why it did not
work for this guy (MH). Does it has anything to do with the ASP.NET version
(I'm running under 2.0, in the discussion 1.1 is mentioned.)

I'm interested in your answer

Thanx

Ton


Show quoteHide quote
"Joy" <J**@discussions.microsoft.com> schreef in bericht
news:20BCB365-68A1-4A01-B223-81D0CD5D827A@microsoft.com...
>
> Hi,
>
> Normally if you are using Forms Authentication, users will be re-directed
> to
> Login page once Session expires.
>
> Another way is to use META Tag. But i will recommend using Forms
> Authentication.
>
> Please also take a look at the following discussion:
>
> http://p2p.wrox.com/asp-net-1-1/28177-session-timeout-redirect-global-asax.html
>
> Let me know if it helped.
>
> regards,
> Joy
>
> "ton" wrote:
>
>> Hi,
>>
>> when the sessionstate timeouts, I want to redirect to a logon page. The
>> problem is that because there are a lot of controls where the user can
>> push
>> on I have to check the expreid sessionstate for each procedure. In the
>> page
>> load event I allready used the
>>
>> Response.Redirect("logon.aspx", False)
>>
>> but (code behind of) the menu which was clicked by the user will
>> executed.
>> Is there a way to avoid checking this for every possible function the
>> user
>> is calling?
>>
>> Ton
>>
>>
Author
9 Jul 2009 3:27 PM
Joy
Hi,

The only thing that has changed in Forms Authentication for ASP.NET 2.0, is
the fact that in 2.0 Forms Authentication can be cookieless (in this case it
uses query string) also (which was not the case in 1.1).

If you have read about Forms Authentication, you would know that once the
user supplies the credentials, Code in the logon page should create a cookie
that contains a forms authentication ticket that is set for the session.

In the discussion url posted earlier i think the guy (MH) has not written
any code to create the cookie.

Please refer the following MSDN Url:

http://msdn.microsoft.com/en-us/library/aa480476.aspx


Let me know if it helps.

regards,
Joy

Show quoteHide quote
"ton" wrote:

> Hi,
>
> I'm now using
>
>         If Session("informatie") & "" = "" Then 'this checks whter the
> sessionvar is filled
>             Response.Redirect("login.aspx")  '                         so
> not Response.Redirect("logon.aspx", False)
>         End If
>
> I've put this instruction in my Page_Init function (and also in my
> page_load, but what ever I choose, the code stops excuting and the
> login.aspx is loaded. So it is solved..
>
> I'did read the discussion you showed me, but could figure out why it did not
> work for this guy (MH). Does it has anything to do with the ASP.NET version
> (I'm running under 2.0, in the discussion 1.1 is mentioned.)
>
> I'm interested in your answer
>
> Thanx
>
> Ton
>
>
> "Joy" <J**@discussions.microsoft.com> schreef in bericht
> news:20BCB365-68A1-4A01-B223-81D0CD5D827A@microsoft.com...
> >
> > Hi,
> >
> > Normally if you are using Forms Authentication, users will be re-directed
> > to
> > Login page once Session expires.
> >
> > Another way is to use META Tag. But i will recommend using Forms
> > Authentication.
> >
> > Please also take a look at the following discussion:
> >
> > http://p2p.wrox.com/asp-net-1-1/28177-session-timeout-redirect-global-asax.html
> >
> > Let me know if it helped.
> >
> > regards,
> > Joy
> >
> > "ton" wrote:
> >
> >> Hi,
> >>
> >> when the sessionstate timeouts, I want to redirect to a logon page. The
> >> problem is that because there are a lot of controls where the user can
> >> push
> >> on I have to check the expreid sessionstate for each procedure. In the
> >> page
> >> load event I allready used the
> >>
> >> Response.Redirect("logon.aspx", False)
> >>
> >> but (code behind of) the menu which was clicked by the user will
> >> executed.
> >> Is there a way to avoid checking this for every possible function the
> >> user
> >> is calling?
> >>
> >> Ton
> >>
> >>
>
>
Author
9 Jul 2009 4:33 PM
ton
the thing is I'm using windows authentication and once noticed the session
variable no longer exists the the  Response.Redirect("login.aspx")  works as
expected. The minor part is that I have to add this in in the Page_PreInit
function for each webform (in my case 4). But that is the easy part of an
appl.

Does this makes sense or can I trap in an other error here?

thanx


ton



Show quoteHide quote
"Joy" <J**@discussions.microsoft.com> schreef in bericht
news:E584FEB3-A90D-46D6-83BD-A760F6179F8D@microsoft.com...
> Hi,
>
> The only thing that has changed in Forms Authentication for ASP.NET 2.0,
> is
> the fact that in 2.0 Forms Authentication can be cookieless (in this case
> it
> uses query string) also (which was not the case in 1.1).
>
> If you have read about Forms Authentication, you would know that once the
> user supplies the credentials, Code in the logon page should create a
> cookie
> that contains a forms authentication ticket that is set for the session.
>
> In the discussion url posted earlier i think the guy (MH) has not written
> any code to create the cookie.
>
> Please refer the following MSDN Url:
>
> http://msdn.microsoft.com/en-us/library/aa480476.aspx
>
>
> Let me know if it helps.
>
> regards,
> Joy
>
> "ton" wrote:
>
>> Hi,
>>
>> I'm now using
>>
>>         If Session("informatie") & "" = "" Then 'this checks whter the
>> sessionvar is filled
>>             Response.Redirect("login.aspx")  '                         so
>> not Response.Redirect("logon.aspx", False)
>>         End If
>>
>> I've put this instruction in my Page_Init function (and also in my
>> page_load, but what ever I choose, the code stops excuting and the
>> login.aspx is loaded. So it is solved..
>>
>> I'did read the discussion you showed me, but could figure out why it did
>> not
>> work for this guy (MH). Does it has anything to do with the ASP.NET
>> version
>> (I'm running under 2.0, in the discussion 1.1 is mentioned.)
>>
>> I'm interested in your answer
>>
>> Thanx
>>
>> Ton
>>
>>
>> "Joy" <J**@discussions.microsoft.com> schreef in bericht
>> news:20BCB365-68A1-4A01-B223-81D0CD5D827A@microsoft.com...
>> >
>> > Hi,
>> >
>> > Normally if you are using Forms Authentication, users will be
>> > re-directed
>> > to
>> > Login page once Session expires.
>> >
>> > Another way is to use META Tag. But i will recommend using Forms
>> > Authentication.
>> >
>> > Please also take a look at the following discussion:
>> >
>> > http://p2p.wrox.com/asp-net-1-1/28177-session-timeout-redirect-global-asax.html
>> >
>> > Let me know if it helped.
>> >
>> > regards,
>> > Joy
>> >
>> > "ton" wrote:
>> >
>> >> Hi,
>> >>
>> >> when the sessionstate timeouts, I want to redirect to a logon page.
>> >> The
>> >> problem is that because there are a lot of controls where the user can
>> >> push
>> >> on I have to check the expreid sessionstate for each procedure. In the
>> >> page
>> >> load event I allready used the
>> >>
>> >> Response.Redirect("logon.aspx", False)
>> >>
>> >> but (code behind of) the menu which was clicked by the user will
>> >> executed.
>> >> Is there a way to avoid checking this for every possible function the
>> >> user
>> >> is calling?
>> >>
>> >> Ton
>> >>
>> >>
>>
>>
Author
9 Jul 2009 5:51 PM
Joy
Hi,
Though you mentioned that you are using Windows Authentication but you
didn't mention the reason behind it. However, i would presume that users
accessing your site have Windows Account on the server (or Active Directory).

Well, the good news is you can have Integrated Authentication in your case
which means:
1. Windows Authentication in IIS.
2. Forms Authentication in ASP.NET.

The following article will give you good insight about what i am referring to:
http://mvolo.com/blogs/serverside/archive/2008/02/11/IIS-7.0-Two_2D00_Level-Authentication-with-Forms-Authentication-and-Windows-Authentication.aspx


I hope this helps.


Do let me know.

regards,
Joy


Show quoteHide quote
"ton" wrote:

> the thing is I'm using windows authentication and once noticed the session
> variable no longer exists the the  Response.Redirect("login.aspx")  works as
> expected. The minor part is that I have to add this in in the Page_PreInit
> function for each webform (in my case 4). But that is the easy part of an
> appl.
>
> Does this makes sense or can I trap in an other error here?
>
> thanx
>
>
> ton
>
>
>
> "Joy" <J**@discussions.microsoft.com> schreef in bericht
> news:E584FEB3-A90D-46D6-83BD-A760F6179F8D@microsoft.com...
> > Hi,
> >
> > The only thing that has changed in Forms Authentication for ASP.NET 2.0,
> > is
> > the fact that in 2.0 Forms Authentication can be cookieless (in this case
> > it
> > uses query string) also (which was not the case in 1.1).
> >
> > If you have read about Forms Authentication, you would know that once the
> > user supplies the credentials, Code in the logon page should create a
> > cookie
> > that contains a forms authentication ticket that is set for the session.
> >
> > In the discussion url posted earlier i think the guy (MH) has not written
> > any code to create the cookie.
> >
> > Please refer the following MSDN Url:
> >
> > http://msdn.microsoft.com/en-us/library/aa480476.aspx
> >
> >
> > Let me know if it helps.
> >
> > regards,
> > Joy
> >
> > "ton" wrote:
> >
> >> Hi,
> >>
> >> I'm now using
> >>
> >>         If Session("informatie") & "" = "" Then 'this checks whter the
> >> sessionvar is filled
> >>             Response.Redirect("login.aspx")  '                         so
> >> not Response.Redirect("logon.aspx", False)
> >>         End If
> >>
> >> I've put this instruction in my Page_Init function (and also in my
> >> page_load, but what ever I choose, the code stops excuting and the
> >> login.aspx is loaded. So it is solved..
> >>
> >> I'did read the discussion you showed me, but could figure out why it did
> >> not
> >> work for this guy (MH). Does it has anything to do with the ASP.NET
> >> version
> >> (I'm running under 2.0, in the discussion 1.1 is mentioned.)
> >>
> >> I'm interested in your answer
> >>
> >> Thanx
> >>
> >> Ton
> >>
> >>
> >> "Joy" <J**@discussions.microsoft.com> schreef in bericht
> >> news:20BCB365-68A1-4A01-B223-81D0CD5D827A@microsoft.com...
> >> >
> >> > Hi,
> >> >
> >> > Normally if you are using Forms Authentication, users will be
> >> > re-directed
> >> > to
> >> > Login page once Session expires.
> >> >
> >> > Another way is to use META Tag. But i will recommend using Forms
> >> > Authentication.
> >> >
> >> > Please also take a look at the following discussion:
> >> >
> >> > http://p2p.wrox.com/asp-net-1-1/28177-session-timeout-redirect-global-asax.html
> >> >
> >> > Let me know if it helped.
> >> >
> >> > regards,
> >> > Joy
> >> >
> >> > "ton" wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> when the sessionstate timeouts, I want to redirect to a logon page.
> >> >> The
> >> >> problem is that because there are a lot of controls where the user can
> >> >> push
> >> >> on I have to check the expreid sessionstate for each procedure. In the
> >> >> page
> >> >> load event I allready used the
> >> >>
> >> >> Response.Redirect("logon.aspx", False)
> >> >>
> >> >> but (code behind of) the menu which was clicked by the user will
> >> >> executed.
> >> >> Is there a way to avoid checking this for every possible function the
> >> >> user
> >> >> is calling?
> >> >>
> >> >> Ton
> >> >>
> >> >>
> >>
> >>
>
>
Author
9 Jul 2009 7:47 PM
ton
I have to be honest ....

I did not think about the authentication anyway, it is the default, but yes.
My users have a windows acount on the server, but I have to admit I let them
log on to my app with a different username and password, which I allready
thought is not a good idea. So I keep the windows authentication, but will
use it the way it should. (I suppoose I should let them fill in the windows
password?, or what else).

thanx, I will study this carefully

(BTW the software isn't beta yet)

Ton

Show quoteHide quote
"Joy" <J**@discussions.microsoft.com> schreef in bericht
news:0D89D4CC-92D7-4407-A17C-AFD01C0474B3@microsoft.com...
>
> Hi,
> Though you mentioned that you are using Windows Authentication but you
> didn't mention the reason behind it. However, i would presume that users
> accessing your site have Windows Account on the server (or Active
> Directory).
>
> Well, the good news is you can have Integrated Authentication in your case
> which means:
> 1. Windows Authentication in IIS.
> 2. Forms Authentication in ASP.NET.
>
> The following article will give you good insight about what i am referring
> to:
>
> http://mvolo.com/blogs/serverside/archive/2008/02/11/IIS-7.0-Two_2D00_Level-Authentication-with-Forms-Authentication-and-Windows-Authentication.aspx
>
>
> I hope this helps.
>
>
> Do let me know.
>
> regards,
> Joy
>
>
> "ton" wrote:
>
>> the thing is I'm using windows authentication and once noticed the
>> session
>> variable no longer exists the the  Response.Redirect("login.aspx")  works
>> as
>> expected. The minor part is that I have to add this in in the
>> Page_PreInit
>> function for each webform (in my case 4). But that is the easy part of an
>> appl.
>>
>> Does this makes sense or can I trap in an other error here?
>>
>> thanx
>>
>>
>> ton
>>
>>
>>
>> "Joy" <J**@discussions.microsoft.com> schreef in bericht
>> news:E584FEB3-A90D-46D6-83BD-A760F6179F8D@microsoft.com...
>> > Hi,
>> >
>> > The only thing that has changed in Forms Authentication for ASP.NET
>> > 2.0,
>> > is
>> > the fact that in 2.0 Forms Authentication can be cookieless (in this
>> > case
>> > it
>> > uses query string) also (which was not the case in 1.1).
>> >
>> > If you have read about Forms Authentication, you would know that once
>> > the
>> > user supplies the credentials, Code in the logon page should create a
>> > cookie
>> > that contains a forms authentication ticket that is set for the
>> > session.
>> >
>> > In the discussion url posted earlier i think the guy (MH) has not
>> > written
>> > any code to create the cookie.
>> >
>> > Please refer the following MSDN Url:
>> >
>> > http://msdn.microsoft.com/en-us/library/aa480476.aspx
>> >
>> >
>> > Let me know if it helps.
>> >
>> > regards,
>> > Joy
>> >
>> > "ton" wrote:
>> >
>> >> Hi,
>> >>
>> >> I'm now using
>> >>
>> >>         If Session("informatie") & "" = "" Then 'this checks whter the
>> >> sessionvar is filled
>> >>             Response.Redirect("login.aspx")  '
>> >> so
>> >> not Response.Redirect("logon.aspx", False)
>> >>         End If
>> >>
>> >> I've put this instruction in my Page_Init function (and also in my
>> >> page_load, but what ever I choose, the code stops excuting and the
>> >> login.aspx is loaded. So it is solved..
>> >>
>> >> I'did read the discussion you showed me, but could figure out why it
>> >> did
>> >> not
>> >> work for this guy (MH). Does it has anything to do with the ASP.NET
>> >> version
>> >> (I'm running under 2.0, in the discussion 1.1 is mentioned.)
>> >>
>> >> I'm interested in your answer
>> >>
>> >> Thanx
>> >>
>> >> Ton
>> >>
>> >>
>> >> "Joy" <J**@discussions.microsoft.com> schreef in bericht
>> >> news:20BCB365-68A1-4A01-B223-81D0CD5D827A@microsoft.com...
>> >> >
>> >> > Hi,
>> >> >
>> >> > Normally if you are using Forms Authentication, users will be
>> >> > re-directed
>> >> > to
>> >> > Login page once Session expires.
>> >> >
>> >> > Another way is to use META Tag. But i will recommend using Forms
>> >> > Authentication.
>> >> >
>> >> > Please also take a look at the following discussion:
>> >> >
>> >> > http://p2p.wrox.com/asp-net-1-1/28177-session-timeout-redirect-global-asax.html
>> >> >
>> >> > Let me know if it helped.
>> >> >
>> >> > regards,
>> >> > Joy
>> >> >
>> >> > "ton" wrote:
>> >> >
>> >> >> Hi,
>> >> >>
>> >> >> when the sessionstate timeouts, I want to redirect to a logon page.
>> >> >> The
>> >> >> problem is that because there are a lot of controls where the user
>> >> >> can
>> >> >> push
>> >> >> on I have to check the expreid sessionstate for each procedure. In
>> >> >> the
>> >> >> page
>> >> >> load event I allready used the
>> >> >>
>> >> >> Response.Redirect("logon.aspx", False)
>> >> >>
>> >> >> but (code behind of) the menu which was clicked by the user will
>> >> >> executed.
>> >> >> Is there a way to avoid checking this for every possible function
>> >> >> the
>> >> >> user
>> >> >> is calling?
>> >> >>
>> >> >> Ton
>> >> >>
>> >> >>
>> >>
>> >>
>>
>>

Bookmark and Share