Cookie ?

W

WJ

Cookie Bakers !

1. I cannot find my cookies in my client XP folder (C:\Documents and
Settings\MyWindowsLoginID\Cookies). I tried to find it while I am still in
the browser and while I log out the web site and quit the browser (MS/IE
6.x). The code is below:

*****************
private void doBakeCookie()
{
string myGuid=Guid.NewGuid().ToString();
FormsAuthentication.Initialize();
bool IWantItPersisted=true;
FormsAuthenticationTicket myFormAuthTicket=new FormsAuthenticationTicket
(1, LogonID.Text, DateTime.Now, DateTime.Now.AddMinutes(60),
IWantItPersisted, myGuid);

string
myEncryptedFormAuthTicket=FormsAuthentication.Encrypt(myFormAuthTicket);
HttpCookie myCookie=new
HttpCookie(FormsAuthentication.FormsCookieName,myEncryptedFormAuthTicket);
Response.Cookies.Add(myCookie);
FormsAuthentication.SetAuthCookie(LogonID.Text,true);
}
***************

2. My Xp enables JS, Cookie, and Session Cookies. Time to expire 1 hour/60
minutes.

3. My web.config is set to CookieLess=False.

4. I am using Session State with cookie. According to Asp.Net, Session ID is
stored in Cookies ? The web site appears to be working properly because all
the pages can query the same session ID via Session.SessioID until I quit
the browser.

Thanks,

John
 
D

Daniel Fisher\(lennybacon\)

First of all

either

Response.Cookies.Add(myCookie);

or

FormsAuthentication.SetAuthCookie(LogonID.Text,true);

They do the same.

Why dont you try:

myCookie.Expiration ...
Response.Cookies.Add(myCookie);
 
W

WJ

Daniel Fisher(lennybacon) said:
Why dont you try:

myCookie.Expiration ...
Response.Cookies.Add(myCookie);

Thanks for your response. Tried your code and it did not make any different

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top