how to store a value in cookie ???
-
I have a login form, and when my users click on the login button to log in my site, i want to create a cookie that store UserID, UserName ... and some information of user. How can i do that in ASP.NET ??? Thus, how can i read the value when cookie is already created ??? Thanks for your answer.
-
I have a login form, and when my users click on the login button to log in my site, i want to create a cookie that store UserID, UserName ... and some information of user. How can i do that in ASP.NET ??? Thus, how can i read the value when cookie is already created ??? Thanks for your answer.
Havent used this... but.. u can give a try from the documentation...
System.Net.Cookie
I was born intelligent
Education ruined me!. -
I have a login form, and when my users click on the login button to log in my site, i want to create a cookie that store UserID, UserName ... and some information of user. How can i do that in ASP.NET ??? Thus, how can i read the value when cookie is already created ??? Thanks for your answer.
Response.Cookies("UserName").Value = "john" Response.Cookies("UserName").Expires = DateTime.Now.AddMinutes(12) The above code will set the value "john" into a cookie variable called "UserName". This cookie expires after 12 minutes. To read the values from Cookie, userid = Request.Cookies("UserName").Value :zzz:----------------------------------------------------------------------:(( T Manjaly
C# Tutorials and samples : http://www.dotnetspider.com -
Response.Cookies("UserName").Value = "john" Response.Cookies("UserName").Expires = DateTime.Now.AddMinutes(12) The above code will set the value "john" into a cookie variable called "UserName". This cookie expires after 12 minutes. To read the values from Cookie, userid = Request.Cookies("UserName").Value :zzz:----------------------------------------------------------------------:(( T Manjaly
C# Tutorials and samples : http://www.dotnetspider.comthanks for your answer :) :)