Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to end Cookie's Session?

How to end Cookie's Session?

Scheduled Pinned Locked Moved ASP.NET
helpquestionhtmlsysadminsecurity
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vijay_83
    wrote on last edited by
    #1

    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.

    M 1 Reply Last reply
    0
    • V vijay_83

      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.

      M Offline
      M Offline
      manojch2
      wrote on last edited by
      #2

      Try This protected void Session_End(Object sender, EventArgs e) { Response.Cookies["__rsauser"].Expires = DateTime.Now.AddDays(-1); }

      manojchilhate

      V 1 Reply Last reply
      0
      • M manojch2

        Try This protected void Session_End(Object sender, EventArgs e) { Response.Cookies["__rsauser"].Expires = DateTime.Now.AddDays(-1); }

        manojchilhate

        V Offline
        V Offline
        vijay_83
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups