session-cookies

How to know when OWIN cookie will expire?

北战南征 提交于 2019-12-17 15:37:07
问题 I would like to create some kind of countdown timer based on the time the OWIN cookie will expire. I am using OWIN with MVC 5 and from what I understand SlidingExpiration is on by default. I do not use 'session' as I need this app to live within a web farm (I dont plan on deploying a session database). 回答1: All you need is to get hold of the CookieValidateIdentityContext during the cookie validation stage. Once you get it, extract whatever you need and keep them as Claim or some other way

Using Python Requests: Sessions, Cookies, and POST

这一生的挚爱 提交于 2019-12-17 15:25:27
问题 I am trying to scrape some selling data using the StubHub API. An example of this data seen here: https://sell.stubhub.com/sellapi/event/4236070/section/null/seatmapdata You'll notice that if you try and visit that url without logging into stubhub.com, it won't work. You will need to login first. Once I've signed in via my web browser, I open the URL which I want to scrape in a new tab, then use the following command to retrieve the scraped data: r = requests.get('https://sell.stubhub.com

Share sessions between php and node

柔情痞子 提交于 2019-12-17 10:47:19
问题 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

Android session management

心已入冬 提交于 2019-12-17 08:34:06
问题 Is there a specific library for Android session management? I need to manage my sessions in a normal Android app. not in WebView . I can set the session from my post method. But when I send another request that session is lost. Can someone help me with this matter? DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("My url"); HttpResponse response = httpClient.execute(httppost); List<Cookie> cookies = httpClient.getCookieStore().getCookies(); if (cookies

Android session management

痞子三分冷 提交于 2019-12-17 08:33:35
问题 Is there a specific library for Android session management? I need to manage my sessions in a normal Android app. not in WebView . I can set the session from my post method. But when I send another request that session is lost. Can someone help me with this matter? DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("My url"); HttpResponse response = httpClient.execute(httppost); List<Cookie> cookies = httpClient.getCookieStore().getCookies(); if (cookies

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

拥有回忆 提交于 2019-12-17 08:00:16
问题 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? 回答1: 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

PHP authentication with multiple domains and subdomains

狂风中的少年 提交于 2019-12-17 07:37:15
问题 I have one main domain: main.com , subdomains: test1.main.com , test2.main.com and other domains one.com , two.com . Now it's done like these: ini_set("session.cookie_domain", ".main.com"); $domain = 'main.com'; login.php $user = $db->query("SELECT id, login FROM users WHERE email=? AND password=?", array($email, $password), "rowassoc"); if($user) { $_SESSION['user_id'] = $user['id']; $_SESSION['user_name'] = $user['login']; $time = 100000; setcookie('email', $email, time() + $time, "/", "."

Scrapy - how to manage cookies/sessions

徘徊边缘 提交于 2019-12-17 04:14:55
问题 I'm a bit confused as to how cookies work with Scrapy, and how you manage those cookies. This is basically a simplified version of what I'm trying to do: The way the website works: When you visit the website you get a session cookie. When you make a search, the website remembers what you searched for, so when you do something like going to the next page of results, it knows the search it is dealing with. My script: My spider has a start url of searchpage_url The searchpage is requested by

Login/signup function not working, @current_user not working, sessions not working

随声附和 提交于 2019-12-14 03:30:11
问题 I'm new to Rails, and am working on a practice app that involves a simple login function. I've been following a tutorial from CodeAcademy by the books, however the code is not working in quite a few ways. First of all, the sessions do not set, even though Rails is executing the rest of the code inside the "if" block shared with the session declaration (btw, no errors are returned). The session controller: class SessionsController < ApplicationController def new end def create @user = User

session_set_cookie_params seems to work but cookies are not affected

旧街凉风 提交于 2019-12-14 03:08:32
问题 I'm using HTTPS and I would like to set the secure attribute for the PHPSESSID and the other cookies I have created. session_set_cookie_params(0,'/','', isset($_SERVER["HTTPS"])); session_start(); $data = session_get_cookie_params(); foreach ($data as $key=>$value) { echo $key.$value; } The function seems to work, in fact, printing out session_get_cookie_params() the secure attribute is equal to 1. But, when I check my cookie state by Firefox or by Firebug+Firecookie they appear to be not