session-cookies

Keep Session Across Page Reload In Backbone JS

心不动则不痛 提交于 2019-12-03 11:21:34
问题 I am consuming an API which returns no cookie on login,but only an auth_token as part of json response. The base URL delivers the backbonejs application. say http://www.webiyo.com/ and by default login page is displayed. I want to keep the user session even if the user refreshes the page in backbonejs app. Problem is that my API doesn't return session cookie aka auth_token cookie ( it just returns an auth_token in a response json which is needed to be passed on all the subsequent calls in the

Understand “current_user” concept when creating a login session in ruby

瘦欲@ 提交于 2019-12-03 08:38:53
I am going through the great Michael Hartl tutorial to build ruby app here . I am trying to understand the concept of how to create a session and I am stuck in understanding this line: self.current_user = user in this method: module SessionsHelper def sign_in(user) cookies.permanent[:remember_token] = user.remember_token self.current_user = user end end I understand the whole concept of creating a cookie with the user_token. But I don't understand what does self.current_user = user means and why is it even necessary to keep this line of code - I have the cookie with the token - why do I need

Multiple applications on a single site - session and forms authentication scope

天涯浪子 提交于 2019-12-03 08:26:51
We're using ASP.NET and IIS 6.0. I realise that the definitions of applications, websites and virtual directories are ill-defined in IIS 6, and changed a lot in IIS 7. However, I'm stuck with IIS 6.0 for now. We have a single web site defined in IIS, and a number of separate sub-sites in Virtual Directories. The scheme looks like this:- http://site.example.com/site1 http://site.example.com/site2 .. etc .. site1, site2, ... are virtual directories in IIS 6.0, under the "Default Web Site". I need to use ASP.NET sessions and forms authentication in most of these sites, and I don't want them to

when should I use cookie-parser with express-session?

做~自己de王妃 提交于 2019-12-03 08:14:26
问题 In most ExpressJs example, I found using cookie-parser with express-session . If I could access session data with req.session.name without it, in what case ( or benefits ) should I be using cookie-parser ? 回答1: For future humble coders, that will stumble upon this - I'm posting an up-to-date answer: As the official description of express-session middleware says here: express-session Since version 1.5.0, the cookie-parser middleware no longer needs to be used for this module to work. This

Does NSURLConnection automatically persist cookies sent from server?

筅森魡賤 提交于 2019-12-03 07:14:11
问题 I logged into my tornado backend from ios and sent back a secure_cookie and i noticed that i could also request other information as long as i validated the secure_cookie that i set. How long does NSURLConnection persist the cookie or will the cookie be deleted once they close the app? This is mentioned in the Apple docs: The URL loading system automatically sends any stored cookies appropriate for an NSURLRequest. unless the request specifies not to send cookies. 回答1: A few facets to your

Most optimized way to delete all sessions for a specific user in Django?

喜欢而已 提交于 2019-12-03 07:03:56
问题 I'm running Django 1.3, using Sessions Middleware and Auth Middleware: # settings.py SESSION_ENGINE = django.contrib.sessions.backends.db # Persist sessions to DB SESSION_COOKIE_AGE = 1209600 # Cookies last 2 weeks Each time a user logs in from a different location (different computer/browser), a new Session() is created and saved with a unique session_id . This can result in multiple database entries for the same user. Their login persists on that node until the cookie is deleted or session

uninitialized constant ActionDispatch::Session::EncryptedCookieStore (NameError)

为君一笑 提交于 2019-12-03 04:15:42
i'm on rails 4 with passenger. everything was working great until i did a bundle just now. now i'm hitting the following error: Web application could not be started uninitialized constant ActionDispatch::Session::EncryptedCookieStore (NameError) /u/sf/ytl/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/rails-2ac97df55230/railties/lib/rails/application/configuration.rb:144:in `const_get' /u/sf/ytl/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/rails-2ac97df55230/railties/lib/rails/application/configuration.rb:144:in `session_store' /u/sf/ytl/.rbenv/versions/2.0.0-p0/lib

Android Login with Token Session: like user logins and stays in session until logout

一个人想着一个人 提交于 2019-12-03 03:57:14
After login in android app, how do I create a token session in the php api? Like this: I would like to make sure that when user log in it will stay in session no matter what happens (crashed, shut down/power down/reboot, leaving the app) at same time the user info data will be sending with all the activities in the app to the webserver. Do I simply use: session_start(); $_SESSION['username'] = $user; $_SESSION['auth'] = "true"; If so how do I pass this session into the android application? Login Authentification in Android App: HttpClient client = new DefaultHttpClient(); String url = "http:/

Checking if user has changed cookie value, manually

99封情书 提交于 2019-12-03 03:45:26
I am busy with a login system for my project. Just for an extra step to the security.. How can I check/detect if a user has manually changed a cookie value? Is there some easy way of doing this? Or do I have to set an extra Session variable and match it up with that? With this being said, is a normal ASP.Net Session traceable by the browser? And viewable to the user? Thanks. Bill Brasky You could append a digital signature to the cookie value and check the signature when you read it back. That way, if the cookie value is tampered with it will be very apparent. private string sign(string

How secure are PHP sessions?

前提是你 提交于 2019-12-03 03:06:30
问题 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?