M
M O J O
Hi,
I have a huge problem.
I'm using cookieless sessionstate. When I try to access a "secure" page
(that is, a page that requires the user has logged in), the user is
redirected to the login page perfectly - no problem.
But when the user IS logged in, and he manually remove the cookie part from
the url (in the address bar) and hit enter, this creates a new session and
when he tries to access my "secure" page again, he is NOT sendt to the login
page. (
What am I doning wrong?
Here's some of my code:
WEB.CONFIG....
<authentication mode="Forms">
<forms name="MyTestApp" path="/" loginUrl="login.aspx" protection="All"
timeout="25"></forms>
</authentication>
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="true" timeout="30" />
LOGIN.ASPX
Dim ticket As New FormsAuthenticationTicket(1, "TestUser",
System.DateTime.Now, System.DateTime.Now.AddMinutes(30), False, "MyTestApp",
FormsAuthentication.FormsCookiePath)
' Encrypt the ticket.
Dim encTicket As String = FormsAuthentication.Encrypt(ticket)
' Create the cookie.
.Response.Cookies.Add(New
HttpCookie(FormsAuthentication.FormsCookieName, encTicket))
Thank you in advance!
M O J O
I have a huge problem.
I'm using cookieless sessionstate. When I try to access a "secure" page
(that is, a page that requires the user has logged in), the user is
redirected to the login page perfectly - no problem.
But when the user IS logged in, and he manually remove the cookie part from
the url (in the address bar) and hit enter, this creates a new session and
when he tries to access my "secure" page again, he is NOT sendt to the login
page. (
What am I doning wrong?
Here's some of my code:
WEB.CONFIG....
<authentication mode="Forms">
<forms name="MyTestApp" path="/" loginUrl="login.aspx" protection="All"
timeout="25"></forms>
</authentication>
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="true" timeout="30" />
LOGIN.ASPX
Dim ticket As New FormsAuthenticationTicket(1, "TestUser",
System.DateTime.Now, System.DateTime.Now.AddMinutes(30), False, "MyTestApp",
FormsAuthentication.FormsCookiePath)
' Encrypt the ticket.
Dim encTicket As String = FormsAuthentication.Encrypt(ticket)
' Create the cookie.
.Response.Cookies.Add(New
HttpCookie(FormsAuthentication.FormsCookieName, encTicket))
Thank you in advance!
M O J O