Why would you expect it to convert a List of strigns to a string for you?
If you wrote this:
List<string> list = new List<string>();
string s = (string) list;
You would expect an error woudln;t you?
So when you do this:
var selectedProducts = GridView1.Rows.Cast<gridviewrow>()
.Where(row => ((CheckBox)row.FindControl("SelectedProducts")).Checked)
.Select(row => GridView1.DataKeys[row.RowIndex].Value.ToString()).ToList();
if (Session["Cart"] == null)
{
Session["Cart"] = selectedProducts;
...
string data = (string)Session["Cart"];</gridviewrow>
That is exactly what your are trying to do!
Try getting the list from the session instead?
List<string> data = (List<string>)Session["Cart"];</string></string>