Note that there are some explanatory texts on larger screens.

plurals
  1. POClear cookies while logging out
    primarykey
    data
    text
    <p>i have a keep me logged in check box so i'm using cookies to implement it, but my problem is that i have 2 links to log out and when i click on each one i'm not being redirected to the log in page because on the load of the log in page i'm testing if the cookie is full and it's always full.. because when logging out i'm not able to clear the cookie... i tried calling a function from back end to clear the cookie but it did not fire so can you help me please?</p> <pre><code> Protected Sub btn_login_Click(sender As Object, e As System.EventArgs) Handles btn_login.Click If Session("valid") Then If (loginkeeping.Checked = True) Then Dim mycookie As New HttpCookie("LoginDetail") Dim username As TextBox = Page.FindControl("username_txtt") Dim password As TextBox = Page.FindControl("passwordsignup") mycookie.Values("Username") = username.Text.Trim() mycookie.Values("Password") = password.Text.Trim() 'mycookie.Expires = System.DateTime.Now.AddDays(1) Response.Cookies.Add(mycookie) End If Response.Redirect("Insert_Content.aspx") End If End Sub Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not (Response.Cookies("LoginDetail") Is Nothing) Then Response.Redirect("Insert_Content.aspx") End If End Sub </code></pre> <p>asp.net:</p> <pre><code>&lt;ul id="nav" class="fl"&gt; &lt;li class="v-sep"&gt; &lt;asp:HyperLink ID="logUser" runat="server" class="round button dark menu-user image-left"&gt;&lt;/asp:HyperLink&gt; &lt;ul&gt; &lt;li&gt;&lt;asp:HyperLink ID="Myprofile" NavigateUrl="~/Profile.aspx" runat="server"&gt;My Profile&lt;/asp:HyperLink&gt; &lt;li&gt;&lt;asp:HyperLink ID="changePAss" NavigateUrl="~/Change_Password.aspx" runat="server"&gt;Change Password&lt;/asp:HyperLink&gt;&lt;/li&gt; &lt;li&gt;&lt;asp:HyperLink ID="logout" NavigateUrl="~/LOGIN.aspx" runat="server" onClick="logoutt"&gt;Log out&lt;/asp:HyperLink&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="LOGIN.aspx" runat="server" class="round button dark menu-logoff image-left" onClick="logoutt"&gt;Log out&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;!-- end nav --&gt; Public Sub logoutt() Dim CookieName As HttpCookie = Request.Cookies("username") CookieName.Expires.AddMilliseconds(1) CookieName.Value = Nothing Response.Cookies.Add(CookieName) End Sub </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload