session-cookies

Asp.Net: Retaining the old browser session after closing and reopening browser instance

旧城冷巷雨未停 提交于 2019-12-06 08:47:56
问题 Is there a way I can retain the browser session after the user has closed his browser and then reopens. The default behavior in asp.Net is that it keeps the Asp.Net SessionId in the browser cookie which expires when we close the browser. On reopen the browser asp.net generates a new SessionId and even if the old session is not expired on the server side we can not retain it. Can we control the expiration behavior of the session cookie in Asp.Net? 回答1: You cannot reclaim the session-id as such

Is it possible to set session id to a value of my choice in asp.net

有些话、适合烂在心里 提交于 2019-12-06 07:45:47
We are creating a web site with ASP.Net Framework 4.5. I know the way to generate a new sessionId using SessionManager for the current httpContext. I also believe that the sessionId field is readonly and cannot be modified. However, is it possible to create a new session having a sessionId of my choice? For example, if I want the current session Id to have a value "ASDFGHIJKLQWERTY", is it possible to create one? The client insists that it can be done. However, I strongly believe that this is not possible. I'm unable to find any reference justifying that it can or cannot be done. If there are

ASP .NET MVC 3. Session expired too quickly

你离开我真会死。 提交于 2019-12-06 07:21:52
问题 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="

Making JSESSIONID cookie be httpOnly in Jetty 7

独自空忆成欢 提交于 2019-12-06 06:14:39
We're running grails 2.0 + jetty 7.6.6 and need to set JSESSIONID cookie to be httpOnly. All of the answers on stackoverflow seem to refer to either Servlet 3.0 (which requires jetty 8) or to tomcat. Can anyone provide me with a clear way of setting the JSESSIONID cookie be httpOnly for jetty 7.x? I have tried adding jetty-web.xml file with the following contents, but it still didn't work (i.e. the JSESSIONID wasn't marked as httpOnly): <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <Configure class

How to protect web application from cookie stealing attack?

假如想象 提交于 2019-12-06 05:20:19
My web application's authentication mechanism currently is quite simple. When a user logs in, the website sends back a session cookie which is stored (using localStorage ) on the user's browser. However, this cookie can too easily be stolen and used to replay the session from another machine. I notice that other sites, like Gmail for example, have much stronger mechanisms in place to ensure that just copying a cookie won't allow you access to that session. What are these mechanisms and are there ways for small companies or single developers to use them as well? We ran into a similar issue. How

Sessions and subdomains

☆樱花仙子☆ 提交于 2019-12-06 05:15:08
I've been trying to get my sessions running across my subdomains, which I'm pretty sure I got working on Monday but after adding some code Tuesday its not working Wednesday! I've used the code ini_set("session.cookie_domain", $domain); where $domain = .example.com . My site's main page is currently located on test.example.com and I access the login page through test.example.com/login . When i enter this address, the url in the address bar is automatically changed to http://www.test.example.com/login , and this is where the problem lies. The session is created for www.test.example.com but most

(dis)advantages of sessions vs cookies

故事扮演 提交于 2019-12-06 05:07:49
问题 I need some details about sessions. What are the disadvantages of session variables? Between cookies and sessions, which one is better? 回答1: I'm not going to touch on security here as Infotekka already went into it quite a bit. It seems like you are asking whether you should use a SESSION or COOKIE as if they are alternatives to one another. They are not. They server (this was a typo..but I'm leaving it cuz it's a nice pun) different purposes. As HTTP is stateless, PHP (and others) offer the

Session replication in Glassfish Cluster on EC2

不打扰是莪最后的温柔 提交于 2019-12-06 04:45:21
I've built a cluster on Glassfish administred via SSH, where there are 2 instances. I deployed an application that shows the "Session id". This application has in the web.config: <distributable/> And in the sun-web.xml: <session-config> <cookie-properties> <property name="cookieDomain" value="compute.amazonaws.com"/> </cookie-properties> </session-config> I enabled "Availability" in Edit Application. But when I access the 2 web app versions I see different session ids. Can anyone help me? EDIT: As some users noticed, in EC2 is not supported multicast. A solution comes with Glassfish v3.1.2,

Unable to create session in php on AJAX call

China☆狼群 提交于 2019-12-06 04:39:25
I have a example.com/login.php file on root domain with this code header('Access-Control-Allow-Origin: *'); session_set_cookie_params(0, '/', '.example.com'); session_name('lusession'); session_start(); $_SESSION['name'] = $_GET['name']; $_SESSION['useremail'] = $_GET['useremail']; $_SESSION['password'] = $_GET['password']; This file is provided with credentials and it then creates login session. It is called from main domain and subdomains by AJAX. The problem is it doesnot creat session when called through AJAX, but when opened directly in browser as querystring it creates cross domain

What happens to cookies of webview on closing the application?

大兔子大兔子 提交于 2019-12-06 04:31:01
问题 i am using a webview in an app which has keep me signed in functionality like facebook app.so in order to implement i need that the cookie should be persistant.I just wanted to know whether ios persists the cookie by default when the app is closed or i need to save the cookie manually before closing the app to implement keep me signed in functionality. any help would be deeply appreciated. Thanks 回答1: You want to use a NSHTTPCookieStorage object to manage the cookies. The short answer to your