session-cookies

Set cookies with NSURLSession

為{幸葍}努か 提交于 2019-12-02 18:22:45
Hi I am developing one Iphone application In which I want to set cookies after server response and use that for another request. My network request looks like. NSURLSession *session = [NSURLSession sharedSession]; [[session dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { NSHTTPURLResponse *httpResp = (NSHTTPURLResponse*) response; NSLog(@"sttaus code %i", httpResp.statusCode); if (error) { [self.delegate signinWithError:error]; } else { [self.delegate signinWithJson:data]; } }] resume]; But I don't know how to set cookies. I know I have to use

how to refresh JSESSIONID cookie after login

不羁岁月 提交于 2019-12-02 16:17:18
A product I work on got a tough security audit by a potential customer and they are upset that Tomcat sets a JSESSIONID cookie before authentication has happened. That is, Tomcat sets this cookie when our stateless Login Page loads, but before login. They suggest either of the following: issue a new JSESSIONID cookie after login prevent a JSESSIONID cookie from being set in the first place on the Login Page (i.e., before authentication has happened) I have been poring through everything JSESSIONID-related on this site and can find no easy answer. I'm just hoping for some ideas. My best

How secure are PHP sessions?

假如想象 提交于 2019-12-02 15:34:40
I'm primarily a C++ programmer, but I'm trying to pick up some PHP. Apparently the way to implement web user sessions is to store the user's login ID in a cookie using the $_SESSION variable. Is it not possible for someone to just modify their cookie, to give them different privileges or log in as a different user? It seems like this authentication mechanism is just having the user store their ID in a file - and then just trusting them not to change it. Is there something that prevents this? Thanks! James No, a session is stored on the server and cannot be accessed by the user. It is used to

How implement 'remember me' in laravel 5.1?

主宰稳场 提交于 2019-12-02 12:29:21
问题 How to implement rememeber me functionality in laravel 5.1? Can anyone give me an example? 回答1: Laravel authentication offers remember me functionality out of the box. In order to use it you need to do 2 things: add remember_token column in your users table - this is where the token will be stored pass true as a second parameter of Auth::attempt() to enable remember me behaviour If you do this, Laravel will generate a token that will be saved in users table and in a cookie. On subsequent

Cookies aren't persisting in PHP?

主宰稳场 提交于 2019-12-02 11:25:34
问题 How do I get the cookies to persist in php? give_cookie.php <?php if (!isset($_COOKIE["muffin"])) setcookie("muffin", "55", 100 * 60 * 60 * 24 * 30); $_COOKIE["lid"]=true; ?> jar.php <?php var_dump($_COOKIE); if($_COOKIE["lid"]) echo "open"; ?> Running the code in that order gives me output: array(0) { } Notice: Undefined index: lid in jar.php on line 3 Embedding the code from jar.php in give_cookie.php gives me output: array(1) { ["lid"]=> bool(true) } open 回答1: You're supposed to give a

How to save session_id as cookie value and send it to server in Android?

試著忘記壹切 提交于 2019-12-02 11:16:00
问题 I am working on a app using web services calls. I am calling my Login webservice as follows String url = "http://mydomaim.com/login.php"; UserFunctions userFunction = new UserFunctions(); JSONObject json = userFunction.loginUser(userEmail, password, url); It works fine and send me response as show below { "userName":"a", "login_success":1, "user_id":"3", "session_id":"1067749aae85b0e6c5c5e697b61cd89d", "email":"a" } I parse this response, and successfully and got the session id in a variable.

Magento external login will not create session cookie

爷,独闯天下 提交于 2019-12-02 09:59:27
I am trying to replace a rather clumpsy ajax-login of Magento from an external site. The site uses Magento as a shop. Both the site and the magento-shop has their own logins, therefor when a user logs in it is important that both are synchronized. This was done with an ajax-call each page reload, keeping the user logged into Magento. I want to remove this so I created a check on each page reload which will do everything server-side. My problem is, the following code does not work properly: //Get Magento session-object Mage::getSingleton("core/session", array("name"=>"frontend")); $session =

PHP Session lost half way through buying process

。_饼干妹妹 提交于 2019-12-02 08:35:26
THE SET UP I have a buying process that has the following stages: results customer payment order-conf The results page sets a session variable with an ID from our orders database table. Each page posts data to the next one. The start of customer and payment BOTH check the existence of the ID number session variable. As you can imagine, 99% of browsers with default cookie settings have no problem with the setting of these sessions vars and reading them. I get an alert whenever that session var check comes back as blank. Most of these errors seem to be direct hits to the customer and payment

Security: Session Identifier Not Updated in tcl

安稳与你 提交于 2019-12-02 06:34:27
问题 I'm working on open-source application "Project-Open" and during the scanning I got the following vulnerability: [Medium] Session Identifier Not Updated Issue: 13800882 Severity: Medium URL: https://<server_name>/register/ Risk(s): It is possible to steal or manipulate customer session and cookies, which might be used to impersonate a legitimate user,allowing the hacker to view or alter user records, and to perform transactions as that user Fix: Do not accept externally created session

Setting ServiceStack Cookie Domain in Web.Config Causes Session Id to Change on Every Request

廉价感情. 提交于 2019-12-02 05:08:15
问题 As per ServiceStack - Authentication for domain and subdomains, I set the cookie domain in the httpCookies section and it in fact works - it sets the domain of the cookie properly. But what I noticed is, once I add this line to the config, a new session id is generated on every request, regardless if the user has already been authenticated. My code is bare bones and simple. My app host code: public override void Configure(Funq.Container container) { Plugins.Add(new AuthFeature(() => new