Click here to Skip to main content
15,908,931 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionDatagrid in ajax Pin
alokdotnet28-Aug-06 17:19
alokdotnet28-Aug-06 17:19 
QuestionUsing Asp page in Asp.net Pin
alokdotnet28-Aug-06 17:15
alokdotnet28-Aug-06 17:15 
AnswerRe: Using Asp page in Asp.net Pin
Guffa28-Aug-06 19:04
Guffa28-Aug-06 19:04 
QuestionEnter Text into Detailsview on Insert. Pin
japel28-Aug-06 16:15
japel28-Aug-06 16:15 
QuestionWhy is only my first dropdown list maintains its selection? Pin
littlecuttiepie28-Aug-06 12:37
littlecuttiepie28-Aug-06 12:37 
AnswerRe: Why is only my first dropdown list maintains its selection? Pin
Not Active28-Aug-06 16:50
mentorNot Active28-Aug-06 16:50 
QuestionDrop file extension HttpModule + Login Control Pin
eggsovereasy28-Aug-06 10:59
eggsovereasy28-Aug-06 10:59 
QuestionForm Authentication Pin
Bassam Saoud28-Aug-06 10:32
Bassam Saoud28-Aug-06 10:32 
I am working with ASP.NET 2.0 and VS 2005 to implement a new functionality.The functionality is to simply warn the user through a popup window before a predefined time that Session is about to timout.The user has two choices, either to ignore the warning or to renew the Authentication.

I am creating FormsAuthenticationTicket to define the timeout interval as displayed below:
<br />
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate<br />
        If Membership.ValidateUser(Login1.UserName, Login1.Password) Then<br />
            Dim oTimeout As Integer = (Convert.ToInt32(ConfigurationManager.AppSettings("TotalTimeOut")) / 60)<br />
            Dim ticket As FormsAuthenticationTicket = New FormsAuthenticationTicket(1, _<br />
             Login1.UserName, _<br />
             DateTime.Now, _<br />
             Date.Now.AddMinutes(oTimeout), _<br />
             Login1.RememberMeSet(), _<br />
             "", _<br />
             FormsAuthentication.FormsCookiePath)<br />
<br />
            ' Encrypt the ticket.<br />
            Dim encTicket As String = FormsAuthentication.Encrypt(ticket)<br />
<br />
            ' Create the cookie.<br />
            Response.Cookies.Add(New HttpCookie(FormsAuthentication.FormsCookieName, encTicket))<br />
<br />
            ' Redirect back to original URL.<br />
            Response.Redirect(FormsAuthentication.GetRedirectUrl(Login1.UserName, Login1.RememberMeSet()))<br />
<br />
<br />
        End If<br />
    End Sub<br />


I am displaying the Warning by using Page.IsClientScriptBlockRegistered to register a Javascript function that is called with windows.setinterval.

The problem I am facing is how to renew the Authentication.I tried to update the cookie expire date and it back to the cookiecollection but that didnt work:

<br />
authCookie As HttpCookie = Request.Cookies(FormsAuthentication.FormsCookieName)<br />
authCookie.Expires = DateTime.Now.AddMinutes(oTimeout)<br />


I've also tried to signout the user (FormsAuthentication.Signout) and recreate a new ticket and that didnt work either.

I really appreciate any help.
Questionimporting a swish file into ASP.NET Pin
Insia28-Aug-06 9:02
Insia28-Aug-06 9:02 
QuestionWeb Service vs. Web Form Security Pin
JimmyG1328-Aug-06 7:49
JimmyG1328-Aug-06 7:49 
QuestionWhat is "content file" and "code-behind file" ? Pin
Husam Burhan28-Aug-06 7:16
Husam Burhan28-Aug-06 7:16 
AnswerRe: What is "content file" and "code-behind file" ? Pin
japel28-Aug-06 16:43
japel28-Aug-06 16:43 
QuestionPassing Controls Pin
cisco210328-Aug-06 4:06
cisco210328-Aug-06 4:06 
AnswerRe: Passing Controls Pin
coolestCoder28-Aug-06 4:42
coolestCoder28-Aug-06 4:42 
GeneralRe: Passing Controls Pin
Not Active28-Aug-06 5:13
mentorNot Active28-Aug-06 5:13 
GeneralRe: Passing Controls Pin
cisco210328-Aug-06 5:22
cisco210328-Aug-06 5:22 
GeneralRe: Passing Controls Pin
Not Active28-Aug-06 5:57
mentorNot Active28-Aug-06 5:57 
AnswerRe: Passing Controls Pin
Not Active28-Aug-06 5:11
mentorNot Active28-Aug-06 5:11 
GeneralRe: Passing Controls Pin
cisco210328-Aug-06 5:26
cisco210328-Aug-06 5:26 
GeneralRe: Passing Controls Pin
Not Active28-Aug-06 5:55
mentorNot Active28-Aug-06 5:55 
Questionhi Pin
FREAK880228-Aug-06 4:01
FREAK880228-Aug-06 4:01 
QuestionNew to Asp.Net Pin
drc_no128-Aug-06 3:39
drc_no128-Aug-06 3:39 
AnswerRe: Read XML file from App_Data Pin
Guffa28-Aug-06 4:01
Guffa28-Aug-06 4:01 
GeneralRe: New to Asp.Net [modified] Pin
drc_no128-Aug-06 4:22
drc_no128-Aug-06 4:22 
GeneralRe: Read XML file from App_Data Pin
drc_no128-Aug-06 4:50
drc_no128-Aug-06 4:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.