protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["error"] == "access_denied")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('User has denied access.')", true);
                    Response.Redirect("/Front.aspx");
                    return;
                }

                string code = Request.QueryString["code"];
                if (!string.IsNullOrEmpty(code))
                {
                    string access_token_data = Fetch_Access_Token(code);
                    string user_token = access_token_data.Split("=".ToCharArray())[1].Split("&".ToCharArray())[0];
                    FacebookClient fb = new FacebookClient(user_token);
                    fb.AppSecret = FacebookHelper.API_Secret;
                    fb.AppId = FacebookHelper.API_Key;

                    var result = (IDictionary<string, object>)fb.Get("/me");
                    string name = (string)result["name"];
                    long fb_id = long.Parse((string)result["id"]);
                    string email = (string)result["email"];
                    string pictureurl = string.Format("https://graph.facebook.com/{0}/picture", fb_id);

                    RideHop.Data.Lib.Entity.FacebookUser faceBookUser = new FacebookUser() { Name = name, FbId = fb_id, Email = email, PictureUrl = pictureurl };
                    DataService ds = new DataService();
                    //var test = ds.AuthenticateUser(faceBookUser);
                    Session.Add("logged_in", true);
                    Session.Add("rh_user", faceBookUser);
                }
                Response.Redirect("/Front.aspx");
            }
        }
        static void Runn(string[] args)
        {
            DataService ds = new DataService();
            FacebookUser fb = new FacebookUser() { FbId = 666, AboutMe = "werwer", Email = "*****@*****.**", Name = "AHILAN", Phone = "911", PictureUrl = "YYYY" };
            FacebookUser fb2 = new FacebookUser() { FbId = 667, AboutMe = "werwer", Email = "*****@*****.**", Name = "AHILAN2", Phone = "911", PictureUrl = "YYYY" };
            FacebookUser fb3 = new FacebookUser() { FbId = 668, AboutMe = "werwer", Email = "*****@*****.**", Name = "AHILAN3", Phone = "911", PictureUrl = "YYYY" };
            ds.AuthenticateUser(fb);
            ds.AuthenticateUser(fb2);
            ds.AuthenticateUser(fb3);
            List<long> hi = new List<long> { 12, 12, 12, 12 };
            RideHostSession s1 = new RideHostSession() { RideHostID = 666, PostedTime = DateTime.Now, DepartTime = DateTime.Now, EstimatedArrivalTime = DateTime.Now, LocationTo = "Toronto", LocationFrom = "Waterloo", Riders = new long[] { 1, 1, 1 }, RideRequests = hi, Price = 12, AdditionalMessage = "no" };
            RideHostSession s2 = new RideHostSession() { RideHostID = 699, PostedTime = DateTime.Now, DepartTime = DateTime.Now, EstimatedArrivalTime = DateTime.Now, LocationTo = "Markham", LocationFrom = "Waterloo", Riders = new long[] { 1, 1, 1 }, RideRequests = hi, Price = 12, AdditionalMessage = "no" };
            RideHostSession s3 = new RideHostSession() { RideHostID = 698, PostedTime = DateTime.Now, DepartTime = DateTime.Now, EstimatedArrivalTime = DateTime.Now, LocationTo = "Ajax", LocationFrom = "Waterloo", Riders = new long[] { 1, 1, 1 }, RideRequests = hi, Price = 12, AdditionalMessage = "no" };
            RideHostSession s4 = new RideHostSession() { RideHostID = 697, PostedTime = DateTime.Now, DepartTime = DateTime.Now, EstimatedArrivalTime = DateTime.Now, LocationTo = "Weber", LocationFrom = "Waterloo", Riders = new long[] { 1, 1, 1 }, RideRequests = hi, Price = 12, AdditionalMessage = "no" };
            ds.StoreRideSession(s1);
            RideRequest r1 = new RideRequest() {RequestedById = 667, RequestedToId = 666, SessionId = s1.SessionID, AdditionalMessage = "hey", Accepted = false, SeenByHost = false, SeenByRequester = false };
            RideRequest r2 = new RideRequest() { RequestedById = 668, RequestedToId = 666, SessionId = s1.SessionID, AdditionalMessage = "heyyo", Accepted = false, SeenByHost = false, SeenByRequester = false };
            ds.StoreRideRequest(r1);
            ds.StoreRideRequest(r2);

            List<RideRequest> hi2 = ds.GetRequests(fb2, true, 10);
            ds.GetPostedRides(10, Lib.Enums.SortRideBy.Hot, fb);
        }