How to end Cookie's Session?
-
Hi, Iam working in a webapplication in which I am using RSA cookie authentication to login. I login using secure RSA ID in which i login using different users with different Tokens such as Admin , client etc.., for ex.. if i login using Admin account and RSA pincode i have to redirect to a different destination page than that of the client account's destination page. The thing is that i have written RSA secured Cookie for login in a page called Authorize.aspx as follows in the HTML page of Authorize.aspx: <% Dim RSACookieAPI '//Response.Cookies["RSACookieAPI"].Expires = DateTime.Now.AddYears(-30) RSACookieAPI = Server.CreateObject("Rsacookieapi.RSACookie") %> Hello <%=RSACookieAPI.RSAGetUserName() %> <% session("rsauser")=RSACookieAPI.RSAGetUserName() %> <% Response.Redirect("auth.aspx") %> My question is that when i click logout in the destination page for each account the RSA cookie's time frame and user's session should expire and come to the home page. I don't know how to end the RSA cookie's session as i have different accounts in each page from which i logout. So pls help me with this issue. i think i have confused u a bit with my question. Sorry for that. pls help me with this issue. Thanks and Regards Vijay.
-
Hi, Iam working in a webapplication in which I am using RSA cookie authentication to login. I login using secure RSA ID in which i login using different users with different Tokens such as Admin , client etc.., for ex.. if i login using Admin account and RSA pincode i have to redirect to a different destination page than that of the client account's destination page. The thing is that i have written RSA secured Cookie for login in a page called Authorize.aspx as follows in the HTML page of Authorize.aspx: <% Dim RSACookieAPI '//Response.Cookies["RSACookieAPI"].Expires = DateTime.Now.AddYears(-30) RSACookieAPI = Server.CreateObject("Rsacookieapi.RSACookie") %> Hello <%=RSACookieAPI.RSAGetUserName() %> <% session("rsauser")=RSACookieAPI.RSAGetUserName() %> <% Response.Redirect("auth.aspx") %> My question is that when i click logout in the destination page for each account the RSA cookie's time frame and user's session should expire and come to the home page. I don't know how to end the RSA cookie's session as i have different accounts in each page from which i logout. So pls help me with this issue. i think i have confused u a bit with my question. Sorry for that. pls help me with this issue. Thanks and Regards Vijay.
-
Try This protected void Session_End(Object sender, EventArgs e) { Response.Cookies["__rsauser"].Expires = DateTime.Now.AddDays(-1); }
manojchilhate
Thans Manoj, But how can i call this procedure in my source page, as i click the home link i have to go to a page called UnAuth.aspx in which i have to remove my session completely and have to go to the Home page. So i have to write the coding only in UnAuth.aspx. For that i can't use the cookie i have created in Auth.aspx. How can i call that RSACookie which was initialised in Auth.aspx. pls help me with this issue Manoj. Regards Vijay.