SHARE
TWEET

Facebook Login Via Cookie

a guest Jan 9th, 2018 31 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. ********************
  4. Facebook Login Via Cookie
  5. http://urlin.us/c065n
  6. (Copy & Paste link)
  7. ********************
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56. .. Create a new win forms application, add a button and paste that code inside. WE'RE SORRYTHIS PAGE HAD A ROUGH LANDING 404 Error. –Lloyd Dec 8 '11 at 4:54   I stated that the solution was not the best one in my response. –Tono Nam Dec 8 '11 at 5:21   Figured out how to do it (on first post). I'm getting redirected back to Facebook's main page everytime I execute the code below. –patryk.beza Sep 22 '12 at 15:07   You're welcome! but remember this is against FB Terms Of Service, since we do it for education purposes only, just use it wisely! Cheers patryk.beza –WhySoSerious Nov 18 '12 at 22:00   wow . Here is an example using windows forms. I know that using a webbrowser will make the job easier, but it's too bulky for me (50k mem usage). Facebook sends a cookie everytime you visit it to see if you have cookies enabled, what I did was send a request to the login page of Facebook to get the cookies, then send another with the POST data. –bkaid Dec 8 '11 at 6:02   I often have to use the webrwser control instead of the HttpWebRequest because of this type of reasons. Great, thx u very much. Learn more, including about available controls: Cookies Policy.FacebookJoin or Log Into Facebook  Email or PhonePasswordForgot account?Log InDo you want to join Facebook?Sign UpSign UpCookie JamLoading. Learn more, including about available controls: Cookies Policy.FacebookSign UpLog into FacebookLog InForgot account?  Sign up for FacebookEnglish (US)NederlandsFryskPolskiTrkeDeutschFranais (France)EspaolPortugus (Brasil)ItalianoSign UpLog InMessengerFacebook LiteMobileFind FriendsPeoplePagesPlacesGamesLocationsCelebritiesMarketplaceGroupsRecipesSportsLookMomentsInstagramLocalAboutCreate AdCreate PageDevelopersCareersPrivacyCookiesAd ChoicesTermsHelpSettingsActivity Log Facebook  2018. asked 6 years, 1 month ago viewed 56,659 times active 2 years ago Blog Take the 2018 Developer Survey Linked 5 C# Open web page in default browser with post data 0 WebClient/HttpRequest Navigating To Page After Login 0 Submitting POST form via c# 0 C# generate a cookie dynamically that site will accept? 0 C# - Facebook Login HttpWebRequest POST 0 Passing pameters from Desktop application to aspx page with url 1 Logon to facebook using web-request in powershell 4.0 1 Infinite cycle in login function (CookieCollection) 1 Login to a Website Programmaticaly in Asp.net Related 4853What is the difference between String and string in C#?1476Hidden Features of C#?2345Cast int to enum in C#1176JavaScript post request like a form submit1721What is the best way to iterate over a Dictionary in C#?1863What are the correct version numbers for C#?4068PUT vs. English (US)  Nederlands  Frysk  Espaol  Portugus (Brasil) Privacy  Terms  Advertising  Ad Choices  Cookies  More Candy Crush Saga App Privacy  App Terms  Report/Contact -->. By clicking or navigating the site, you agree to allow our collection of information on and off Facebook through cookies. Loading. Download The Free Pentest Lab Guide! The first thing you need to do if you haven't already is to set up your own pentest/hacking lab. newStream.Close(); HttpWebResponse getResponse = (HttpWebResponse)getRequest.GetResponse(); using (StreamReader sr = new StreamReader(getResponse.GetResponseStream())) { string sourceCode = sr.ReadToEnd(); } This is one of lots ways that works with HttpWebRequest, also if you prefer using WebBrowser, it works acceptable using the following: webBrowser1.Navigate(" "",byteArray, "Content-Type: application/x-www-form-urlencoded"); What I just realized is that it doesn't work with the InternetSetCookie maybe the reason is because Cookies returned from Facebook have the "HttpOnly" attribute (true), and it can't be accessible by client-side script. thanks : ) –sm.abdullah Sep 12 '13 at 12:55 1  well, it's working but my problem is what happens if i want to surf after getting the cookies (i mean after login) ? –LikePod Aug 16 '15 at 22:34 3  didn't work. It could be an outdated link or just a small technical glitch. string getUrl = " string postData = String.Format("email={0}&pass={1}", "value1", "value2"); HttpWebRequest getRequest = (HttpWebRequest)WebRequest.Create(getUrl); getRequest.CookieContainer = new CookieContainer(); getRequest.CookieContainer.Add(cookies); //recover cookies First request getRequest.Method = WebRequestMethods.Http.Post; getRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2"; getRequest.AllowWriteStreamBuffering = true; getRequest.ProtocolVersion = HttpVersion.Version11; getRequest.AllowAutoRedirect = true; getRequest.ContentType = "application/x-www-form-urlencoded"; byte[] byteArray = Encoding.ASCII.GetBytes(postData); getRequest.ContentLength = byteArray.Length; Stream newStream = getRequest.GetRequestStream(); //open connection newStream.Write(byteArray, 0, byteArray.Length); // Send the data. Thanks anyway! :) c# facebook post login httpwebrequest shareimprove this question edited Oct 9 '12 at 20:30 Erwin 4,27332339 asked Dec 8 '11 at 3:01 user1086902 113127   Have you read up on the Facebook API developers.facebook.com/blog/post/395 or facebooksdk.codeplex.com –Lloyd Dec 8 '11 at 5:29 2  This is against the Facebook terms of service. still, thanks! :) –user1086902 Dec 8 '11 at 6:57  show 1 more comment up vote 0 down vote it works great, remains a little problem when I try to connect with multiple accounts, an exception is launched (timeout), I realized that facebook banned connections of successive queries so I tryed to logout every time i want to change user , but i failed . it is nice . private void button1Click(object sender, EventArgs e) { string email = "Your email"; string password = "your password"; // create a new browser WebBrowser w = new WebBrowser(); w.Dock = DockStyle.Fill; this.Controls.Add(w); // you may add the controll to your windows forms if you want to see what is going on // latter you may not chose to add the browser or you can even set it to invisible. .. Would you like to answer one of these unanswered questions instead? Not the answer you're looking for? Browse other questions tagged c# facebook post login httpwebrequest or ask your own question. Plus even though it is agains facebook terms of service it could be used for ethical stuff. –Tono Nam Dec 8 '11 at 5:13   I didn't mark it down! –Lloyd Dec 8 '11 at 5:15   Kk sorry about that. Jump toSections of this pageAccessibility HelpPress alt + / to open this menuRemoveTo help personalize content, tailor and measure ads, and provide a safer experience, we use cookies. HttpWebRequest/HttpWebResponse Cookies613How to make HTTP POST web request1493How does Facebook disable the browser's integrated Developer Tools? Hot Network Questions Is it rude to ignore everybody else in a chatroom and only talk with one person? During single-engine taxi, how is the asymetric power compensated for? What fighters have both 1 & 2 engine versions? How "scrambled" is the data on a RAID5 disk? Is there a list of old browsers that only support TLS 1.0? Compare two numbers given as strings Should a value of a constant be changed over time? Difference between 0-18V and -9V - +9V Is the DC on the Linguist Feat too low? I cannot recognise this kana Can a lack of diseases in the medieval period lead to overpopulation? Finding pair of Amicable numbers under 10000 in C taking too long Time Puzzle Rebus What limits the speed of a car? Tikz, Specifying Exact Dimensions of Shapes on Letterpaper Why is it so inefficient to generate electricity by absorbing heat? A broken mirror Knowing how much resizebox scales Is a verbal response that directly expresses anger always the wrong choice? Why was Harry Truman chosen to be Vice President in 1944? Is standing actually illegal in Venice? What is this methodology called? Why is 11 am + 1 hour == 12:00 pm? ssh - why can I login with partial passwords? more hot questions question feed lang-cs . Stack Overflow Questions Developer Jobs Tags Users current community help chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list  5a02188284
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top