Forms authentication , logged time , get logged username from crypted cookie in the sqldatasource parameter source
<p>I have a sqldatasource and a gridview.
I'm using forms authentication.</p>

<p>After the user logged in , I'm crypting his name</p>

<pre><code>FormsAuthenticationTicket tkt;
      string cookiestr;
      HttpCookie ck;
      tkt = new FormsAuthenticationTicket(1, txtUserName.text, DateTime.Now, 
DateTime.Now.AddMinutes(30), true, false);
      cookiestr = FormsAuthentication.Encrypt(tkt);
      ck = new HttpCookie(FormsAuthentication.FormsCookieName, cookiestr);
      ck.Expires=tkt.Expiration;    
      ck.Path = FormsAuthentication.FormsCookiePath; 
      Response.Cookies.Add(ck);
</code></pre>

<p>In the redirected page I need to set in the sqldatasource , where -> parameter source : cookie</p>

<ul>
<li><p>BUT,</p></li>
<li><p>1.I don't know the cookie name because as I can see it doesn't have one.</p></li>
<li><p>2.Since the cookie was crypted , the sqldatasource must use the decrypted cookie..well..I'm not sure what to do in order to use the username string.</p></li>
</ul>

<p>All in all , I'm trying to crypt his name and in the redirected page to use the logged user name in  a sqldatasource where condition . I can do this if I Don't crypt the cookie but..since the cookie can be edited..I don't want ppl to edit cookies.</p>
