Hello every one, I would appreciate any help in hoe to generate a persistent session ID in Master Page.
Thanks
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Nov 14, 2009, 11:59 PM
you can Generate Session ID in master page also Store the SessionID in Cookie that will presist SessionID even for Months too..
Here is Code How to Set Cookies
public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
string SessionID = HttpContext.Current.Session.SessionID;
// Set cookieHttpCookie cookie = new HttpCookie("CookieName",SessionID);
cookie.Expires = DateTime.Now.AddMinutes(60);
Response.AppendCookie(cookie);
}}