session-cookies

Reopening a session in PHP

老子叫甜甜 提交于 2019-11-27 14:01:45
How do I reopen a session in PHP without getting header already sent warnings? After setting all the session vars I like to set, I close the session with session_write_close() . I do this, because as long as the session is open, there may be only one active connection from the same client. But I like to have multiple parallel ones. However if I like to set another session variable at a later point, I need to reopen the session with session_start() once again. This works, but as I already send code to the client it prints "headers already sent"-warnings. Why is it trying to set the cookie again

Share sessions between php and node

孤者浪人 提交于 2019-11-27 12:57:47
Is there an recent guide (or example code) to using node, express, and redis/predis to share PHPSESSID? I've found several tutorials 1-2 years old and they are all either using old versions express or not using express. Express cookie parser is also deprecated. https://simplapi.wordpress.com/2012/04/13/php-and-node-js-session-share-redi/ NodeJS + ExpressJS + RedisStore Session is undefined It would be great if someone could post some more recent code... EDIT - extract of node server code so far: var express = require('express'), app = express(), server = require('http').createServer(app), io =

Fully disable cookies in Laravel 4 API

∥☆過路亽.° 提交于 2019-11-27 12:29:57
问题 I am using Laravel to build a RESTful API. I use Basic HTTP Auth ( Authenticate header ), with this filter: Route::filter('auth', function() { $credentials = ['email' => Request::getUser(), 'password' => Request::getPassword()]; if (!Auth::once($credentials)) { $response = ['error' => true, 'message' => 'Unauthorized request']; $code = 401; $headers = ['WWW-Authenticate' => 'Basic']; return Response::json($response, $code, $headers); } }); It works, but Laravel then tries to set a cookie for

ANDROID : Share session between Webview and httpclient

一笑奈何 提交于 2019-11-27 11:30:45
I have actually a logged session in my WebView. But I use also httpclient to send and get data from the web. I saw on the internet that it's impossible to get the content of a WebView, so I needed to use my httpclient to get data from a webservice. The problem is that this webservice uses sessions... and my session is in my WebView, so the httpclient doesn't have it and I can't access the content of the webservice. I see many posts about this problem but I didn't understand the solution. Here is what i did on my onPageStarted : CookieManager mgr = CookieManager.getInstance(); Log.i( "URL", url

localStorage vs sessionStorage vs cookies

こ雲淡風輕ζ 提交于 2019-11-27 10:51:06
I am working in an app where I need to keep some data during the user is logged in and I have that question, what is the difference among localStorage, sessionStorage, cookies ??? I was asking what can I use in order to persist some data in the DOM, even if the user refresh the page, some people says: use sessionStorage, or localStorage, then, someone came up with the idea of use ngCookies because it works in every browser, but, which should I use ? Rouby localStorage and sessionStorage are both so-called WebStorages and features of HTML5. localStorage stores information as long as the user

How to secure the ASP.NET_SessionId cookie?

痴心易碎 提交于 2019-11-27 10:29:27
I have set the .ASPXAUTH cookie to be https only but I am not sure how to effectively do the same with the ASP.NET_SessionId. The entire site uses HTTPS so there is no need for the cookie to work with both http and https. Joel Etherton Here is a code snippet taken from a blog article written by Anubhav Goyal : // this code will mark the forms authentication cookie and the // session cookie as Secure. if (Response.Cookies.Count > 0) { foreach (string s in Response.Cookies.AllKeys) { if (s == FormsAuthentication.FormsCookieName || "asp.net_sessionid".Equals(s, StringComparison

How to use cURL to send Cookies?

自古美人都是妖i 提交于 2019-11-27 10:06:54
I read that Send cookies with curl works, but not for me I have a REST endpoint as class LoginResource(restful.Resource): def get(self): print(session) if 'USER_TOKEN' in session: return 'OK' return 'not authorized', 401 when I try to access as curl -v -b ~/Downloads/cookies.txt -c ~/Downloads/cookies.txt http://127.0.0.1:5000/ * About to connect() to 127.0.0.1 port 5000 (#0) * Trying 127.0.0.1... * connected * Connected to 127.0.0.1 (127.0.0.1) port 5000 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.27.0 > Host: 127.0.0.1:5000 > Accept: */* > * HTTP 1.0, assume close after body < HTTP/1.0 401

What is the difference between server side cookie and client side cookie?

守給你的承諾、 提交于 2019-11-27 10:04:22
What is the difference between creating cookies on the server and on the client? Are these called server side cookies and client side cookies? Is there a way to create cookies that can only be read on the server or on the client? filippo HTTP COOKIES Cookies are key/value pairs used by websites to store state information on the browser. Say you have a website (example.com), when the browser requests a webpage the website can send cookies to store information on the browser. Browser request example: GET /index.html HTTP/1.1 Host: www.example.com Example answer from the server: HTTP/1.1 200 OK

Yahoo Finance Historical data downloader url is not working

拟墨画扇 提交于 2019-11-27 08:29:35
I have used the following url to fetch the historical data from yahoo finance. From last 16th May, 2017 the url is not working. http://real-chart.finance.yahoo.com/table.csv?s=AAL&a=04&b=01&c=2017&d=04&e=02&f=2017&g=d&ignore=.csv Seems like they have changed the url and the new url is: https://query1.finance.yahoo.com/v7/finance/download/AAL?period1=1494873000&period2=1494959400&interval=1d&events=history& crumb=l0aEtuOKocj In the above changed URL has a session cookie which is crumb. Is there any idea how to get this cookie programmatically(in JAVA)? Got it to work, now I just have to parse

TokenMismatchException in VerifyCsrfToken.php line 53 in Laravel 5.1

爱⌒轻易说出口 提交于 2019-11-27 07:42:45
问题 When I try to login show me token error. I have checked token in view form it's right and when comment \App\Http\Middleware\VerifyCsrfToken::class , in the Kernel.php it makes me login but after Redirect to my dashboard I'm not logged in. I am using MAMP on mac. <div> <h1>Login</h1> <div> {!! Form::open(['url'=>'user/login','class' => '']) !!} <input type="hidden" name="_token" value="{{ csrf_token() }}"> <ul> <li><label>Customer Code</label>{!!Form::Text('customer_code',Input::old('customer