Re: Remember Me on this Machine
- From: "John Timney \( MVP \)" <timneyj@xxxxxxxxxxxxx>
- Date: Mon, 29 May 2006 22:45:10 +0100
I forgot to give you the line for cookie duration
Response.Cookies["username"].Value = "Fred"
Response.Cookies["username"].Expires = DateTime.Now.AddDays(1)
That way when you try and read it back it should exist in the clients
browser cookie cache.
Have a read of the cookie guide for asp.net - it explains it all
beautifully.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchASPNETCookies101.asp
--
Regards
John Timney
Microsoft MVP
"Samuel Shulman" <samuel.shulman@xxxxxxxxxxxx> wrote in message
news:eU78CR1gGHA.4776@xxxxxxxxxxxxxxxxxxxxxxx
Thank you for your response,
It doesn't seem to work on my machine
Does the following line:
Response.Cookies["username"].Value = "Fred";
suppose to save the cookie in file so it can be used in the Load event of
the Login page next time the user will try to log on
Samuel
"John Timney ( MVP )" <timneyj@xxxxxxxxxxxxx> wrote in message
news:OthTKS0gGHA.1204@xxxxxxxxxxxxxxxxxxxxxxx
If all your looking to do is set a cookie and retrive it then its as easy
as:
Using System.Web;
Response.Cookies["username"].Value = "Fred";
and to read it back again
Response.Write(Request.Cookies["username"].Value);
There are some examples around already using forms authentication like
http://www.aspcode.net/default.aspx?p=a&i=112
I'm sure you can fish around for more.
--
Regards
John Timney
Microsoft MVP
--
Regards
John Timney
Microsoft MVP
"Samuel Shulman" <samuel.shulman@xxxxxxxxxxxx> wrote in message
news:%23NgiAkzgGHA.3900@xxxxxxxxxxxxxxxxxxxxxxx
Hi
How can I implement a feature of 'Remember me on this computer' I
believe using cookies that next time when the user comes to the login
page I can add the Userename to the appropriate Textbox
Thank you,
Samuel
.
- Follow-Ups:
- Re: Remember Me on this Machine
- From: Samuel Shulman
- Re: Remember Me on this Machine
- References:
- Remember Me on this Machine
- From: Samuel Shulman
- Re: Remember Me on this Machine
- From: John Timney \( MVP \)
- Re: Remember Me on this Machine
- From: Samuel Shulman
- Remember Me on this Machine
- Prev by Date: Re: Regular Expression
- Next by Date: Re: Remember Me on this Machine
- Previous by thread: Re: Remember Me on this Machine
- Next by thread: Re: Remember Me on this Machine
- Index(es):
Relevant Pages
|