session-cookies

How to improve my user login scheme

怎甘沉沦 提交于 2019-12-05 02:59:22
问题 Question is easy and basic. I've been working with PHP sessions for years and I always managed user login/logout this way: Start session ( session_start() call). Login: Store a value in the session (i.e. $_SESSION["user_id"] = 34 ). Check user logged: Check session value (i.e. isset($_SESSION["user_id"]) ). Logout: destroy session ( session_destroy() call and unset($_SESSION["user_id"]) ). This scheme has worked for me with very easy applications, but now I'm working in a bigger application

PhoneGap session (cookies) on iOS

拥有回忆 提交于 2019-12-05 01:51:52
On server we have a set of JSON APIs. There's a login method that authenticates the user and creates user session. Subsequent calls to other methods on the API assume that the user is authenticated. On client side we have PhoneGap and jQuery mobile. We use ajax calls to communicate with server. On Android session management is OK, but on iOS after login it seems like the session cookie is not sent back on next call (or is not accepted at all) and the calls fail on server as if the user is not authenticated. When tested from Safari on the same device everything works fine. Same behaviour is on

JBoss 7.0.1 running without jsessionid in the URL is not working

痞子三分冷 提交于 2019-12-05 01:38:28
Because of some security reasons I deceided to disable session tracking by jsessionid in URL. Before I changed my web.xml to the one below, I had on the first time I visited the page a jsessionid in the url, after clicking the first link, it never appeared again. My web.xml looks like <session-config> <session-timeout>10</session-timeout> <cookie-config> <secure>true</secure> </cookie-config> <tracking-mode>COOKIE</tracking-mode> </session-config> Now I have the jsessionid in the URL, if I click another link on the page it never disappears. It changes on every click. If I try to invoke a JSF

HTTP pages are removing my secure cookies

大憨熊 提交于 2019-12-04 17:35:55
I have a site with mixed HTTP / HTTPS. When the user logs in, she gets two cookies: a regular cookie with her (signed) username, login expire time, and an "insecure" flag a secure cookie with her (signed) username, login expire time, and a "secure" flag note that if you don't have the secure/insecure flag within the signed content, an attacker can intercept the regular cookie and then send it as the secure one (my first implementation made this mistake) I use the regular cookie on HTTP pages (just for showing her name while she browses the marketing portion of the site). Then I use the secure

Destroy PHP Sessions on Browsers Tab Close

此生再无相见时 提交于 2019-12-04 15:57:58
问题 i am stucked, i am working on Projects hotbartendersla i have used a lot of sessions to process data in event booking, now i want to destroy the session when user closed the window/tab of browser,because when ever i open site the selection remains same as i did. i have used this <script type="text/javascript"> window.onbeforeunload = function() { $.post("mysessionsdestroypage.php",function(data){ }); } </script> but when i jumped to on step 2,step 3, my sessions are destroyed and data don't

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

风流意气都作罢 提交于 2019-12-04 14:37:05
问题 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

asp.net can you mix cookieless with cookie session stored session data?

喜你入骨 提交于 2019-12-04 14:09:11
Is it possible to use mixed cookieless sessions with cookie sessions? I've an application that captured user details and then redirect for payment to an ssl page. I was wondering if this is possible? http://www.mydomain.com/confirm.aspx redirects to https://www.mydomain.com/(S(za1tw2l2k02jer4fiskzlovd))/payment.aspx Note: the session Id in the latter url. So in essence, we use the standard cookie session for the majority of the application but when we transfer to an ssl page we pass the SessionId to the https url to pick up the session. I've tried this locally but it starts a new session. Am I

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

邮差的信 提交于 2019-12-04 13:38:35
问题 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

ASP .NET MVC 3. Session expired too quickly

…衆ロ難τιáo~ 提交于 2019-12-04 13:32:50
I have a page (View), which sends AJAX queries in some intervals. User can work with this page very long time. But session expired in about 40-60 minutes. So AJAX-requests don't return usefull information. My Web.config <system.web> <sessionState timeout="259200" cookieName="SunTest.SessionId" regenerateExpiredSessionId="true" sqlCommandTimeout="200" stateNetworkTimeout="200"> </sessionState> <roleManager enabled="true" defaultProvider="SqlProvider" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="259200" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true"

Alternative to cookie based session/authentication

*爱你&永不变心* 提交于 2019-12-04 11:34:05
问题 Is there an alternative to the session feature plugin in servicestack? In some scenarios I cannot use cookies to match the authorized session in my service implementation. Is there a possibility to resolve the session using a token in http header of the request? What is the preferred solution for that in case the browser is blocking cookies? 回答1: I'm using ServiceStack without the built-in auth and session providers. I use a attribute as request filter to collect the user information (id and