Hi,<BR><BR>I&#039;m reasonably new to ASP and have been trying to sort out a problem for the<BR>last three days or so without success - it seems straightforward to me, so I<BR>think I&#039;m missing or misunderstanding something basic.<BR><BR>I am using cookies on a site and want to use a GUID for the unique indicator<BR>that will then be used for DB lookup.<BR><BR>Initially I was setting the GUID through a function (which would generate a<BR>GUID as desired) but I couldn&#039;t write it to the db. Initially I was using a<BR>nvarchar(38) column type and that wouldn&#039;t work, then I switched to a<BR>uniqueidentifier column with a default of NEWID() - that now correctly<BR>generates the ID in the db - but I can&#039;t write it into the cookie as I need<BR>to do that before I write to the db...<BR><BR>I come from a php3 background, where this is very simple - you generate a<BR>md5 hash then write it to the cookie and the db and it is also<BR>straightforward to run a SELECT statement on it when you&#039;re sorting through<BR>the data, hence, I think I am going about this completely the incorrect way,<BR>but so far have been unable to find a tutorial on how to do it.<BR><BR>Essentially I want to:<BR>a)check for cookie<BR>b)if no cookie, generate GUID, write value to cookie and db<BR>c)end<BR>d)if cookie, select record by GUID from cookie then carry on.<BR><BR>An example or some pointers to a good tutorial on how to do the above would<BR>be very much appreciated.<BR><BR>Thanks in advance<BR><BR>Stuart<BR>