cookies

“secure” parameter in session_set_cookie_params

南笙酒味 提交于 2019-12-29 08:59:14
问题 I am interested in learning more about the secure parameter of the function session_set_cookie_params(). Can you tell me how to utilize this properly? If this function is executed on a page that is not secure (but on a server that does have SSL), will it somehow send it securely or do I have to force SSL on the page this function is executed from on my own? 回答1: It means that the client will only send that cookie through a secure (HTTPS) connection. This means you'll have to forward the user

What is the number and size of cookies allowed by major browsers?

筅森魡賤 提交于 2019-12-29 08:33:32
问题 Just wondering what is the size and number of cookies allowed by IE, FF, Chrome, and Safari. What is the number allowed per host and the size of each cookie? Also what would happen if you try to store cookie larger than the max size using Javascript? 回答1: It varies from browser to browser. The biggest limitation is IE6 which can only accept 20 domain cookies (all other modern browsers [FF3+, IE7/8, Safair 4/5, Chrome] can accept much much more). Once IE6 reaches it's 20 cookie limit, it

Javascript to set cookie

拥有回忆 提交于 2019-12-29 08:24:35
问题 I am trying to have a javascript set a cookie that tells Google Translate which language to set the page. I have tried this based on my browser's cookie when selecting a language. <script> $(document).ready(function(){ setcookie(“googtrans”, “/en/fr”, time()+3600, “/”, “www.example.com”); setcookie(“googtrans”, “/en/fr”, time()+3600, “/”, “.example.com”); }); </script> I am not very good with javascript and I get an unexpected token ILLEGAL, not sure what this means: <script>(function() {with

Login into a website and get html from a page

霸气de小男生 提交于 2019-12-29 08:23:15
问题 I'm a little bit confused, I've read about a lot about my problem but without finding an answer. I have to login into a website and fetch some HTML from a page reachable only after logging in. I did this in the past with Visual Basic, using the IE Object and acting like a script, but this gave me a lot of problems, mostly because it's so slow. My website it's easy accessible just using a POST request like <url>/j_security_check?j_username=username&j_password=pass what I don't know is how to

Setting cookies for subdomain

我怕爱的太早我们不能终老 提交于 2019-12-29 08:23:06
问题 i'm making a web app in a restful way. For my client side i'm using angularJs, the same is hosted at - lets say - https://domain.com My backend is built on spring boot and i call all the resources from a subdomain - lets say - https://xyz.domain.com Now when a user logs in , the backend sends an http only cookie to the client. I can see the cookie in response header but its not being set in the browsers cookie. After a bit of research, i have tried sending cookie with domain = .domain.com but

Making web service calls with WCF client + cookies

て烟熏妆下的殇ゞ 提交于 2019-12-29 08:05:28
问题 Been implementing the Basic security Authentication in a WCF Service. Managed to get the .ASPXCookie from the web service. But, how to pass along the received cookie back to the next request? var authClient = new MovieDbClient(); using (new OperationContextScope(authClient.InnerChannel)) { isValid = authClient.Login("userName", "passWord*"); if (isValid) { var response = (HttpResponseMessageProperty)OperationContext.Current.IncomingMessageProperties[HttpResponseMessageProperty.Name];

CORS requests with session/cookie

主宰稳场 提交于 2019-12-29 07:51:51
问题 My application has a PHP server and a client (a JS single-page app). They are separate projects and deployed in different domains. The client consumes a RESTful API exposed by the server. This application is to be integrated with a third party which handles authentication, so users cannot login directly. Our server just receives an SSO token (which comes appropriately signed so that we verify its integrity). We also enforce security at the transport layer for all requests. What I'd like to do

How to read/write cookies for local file:/// HTML document?

余生颓废 提交于 2019-12-29 07:45:29
问题 How can I read/write cookies for local file:/// HTML document using Javascript or jQuery? I tried this one >> function setCookie(c_name, value, exdays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString()); document.cookie = c_name + "=" + c_value; } function getCookie(c_name) { var i, x, y, ARRcookies = document.cookie.split(";"); for (i = 0; i < ARRcookies.length; i++) { x =

how to delete cookie in jquery at the time of browser closing?

ぐ巨炮叔叔 提交于 2019-12-29 07:44:11
问题 I have created a cookie by using jQuery. I want to delete the cookie with jQuery when the browser closes. How do I do this? I've written the following script: $(function () { if ($.cookie('toggle') == "toggle") { $('#toggleText').show(); $('#displayText').text("Less"); } else { $('#toggleText').hide(); $('#displayText').text("More"); } $('#displayText').click(function () { if ($(this).text() == "More") { $('#toggleText').show(); $(this).text("Less"); $.cookie('toggle', 'toggle'); } else { $('

Why is my ASP.NET MVC persistent auth cookie not working?

半城伤御伤魂 提交于 2019-12-29 07:24:06
问题 I'm using ASP.NET MVC 3, with forms authentication (based on modified vanilla account code you get with file->new). When you login, I am setting an auth cookie with FormsAuthentication.SetAuthCookie(userName, true); So this should set a persistent cookie. But if I close the browser and re-open, when I browse to the site I am forced to log in again! I can see using chrome dev tools that the cookie (.ASPXAUTH) is being created and not being deleted when I close the browser, so what's happening?