using System;

using System.Configuration;

using System.Data.SqlClient;

using System.Collections;

 

namespace prjstart

{

       /// <summary>

       /// Summary description for vijaymukhidb.

       /// </summary>

       public class vijaymukhidb

       {

              public string getuserid()

              {

                     // This class file gives the every customerid logging in a unique guid coz it helps the application to identify his cart.

                    

                     //current is the property which gives the current state of http request

                     System.Web.HttpContext context= System.Web.HttpContext.Current;

                     if(context.User.Identity.Name !="")

                     {

                           return context.User.Identity.Name;

                     }

                     if(context.Request.Cookies["vijaycookie"]!=null)

                     {

                           return context.Request.Cookies["vijaycookie"].Value;

                     }

                     else

                     {

                           Guid globalid = Guid.NewGuid();

                           context.Response.Cookies["vijaycookie"].Value = globalid.ToString();

                           return globalid.ToString();

                     }

 

 

Back To Main Page