i put a code in my website to redirect user to paypal sandbox , after entering his email id , and storing it in session ,
in return url of paypal sandbox i mentioned a page but it doesn't work, it doesn't maintaing the session variable, it assigns null to session variable upon returning , even i checked same session variable on every page and it is working but not with the one to which paypal sandbox is returning upon succesful transaction , why ?
i think that redirection between http and https destroys session ,
help plz ?
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class paymentSuccessful : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["tempSubAdmin"] == null)
{
Response.Redirect("wrongEmployerError.aspx");
}
else
{
String subAdminEmail = Session["tempSubAdmin"].ToString();
String conString = "Data Source=COSANOSTRA; MultipleActiveResultSets=true; Initial Catalog=Waleed_orsfinal;Integrated Security=True";
SqlConnection con = new SqlConnection(conString);
String query = "Update tblUser Set paid=1 where email='" + subAdminEmail + "'";
SqlCommand com = new SqlCommand(query, con);
try
{
con.Open();
com.ExecuteNonQuery();
}
catch (Exception exc)
{
Response.Write(exc.Message);
}
finally
{
con.Close();
}
}
}
}