cookies

iOS - web view cookies not set

て烟熏妆下的殇ゞ 提交于 2020-01-05 05:54:10
问题 I am trying to set cookies in my iOS like this: let url = URL(string: "url")! let jar = HTTPCookieStorage.shared let cookieHeaderField = ["Set-Cookie": "key1=value1, key2=value2"] let cookies = HTTPCookie.cookies(withResponseHeaderFields: cookieHeaderField, for: url) jar.setCookies(cookies, for: url, mainDocumentURL: url) let request = URLRequest(url: url) viewerWebKit.load(request) Then I am printing them like this: viewerWebKit.configuration.websiteDataStore.httpCookieStore.getAllCookies( {

How to get a specified Cookie path using javascript

大城市里の小女人 提交于 2020-01-05 05:37:25
问题 Is there anyway to get a specified cookie's Path in Javascript , i have a javascript method which will return cookie value based on the name . Is it possible to add filter to the method such that it will fetch from particular paths cookies only ? requirement is to fetch cookie from a path named /ctp ? function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if

C# Login code not work on safari

拜拜、爱过 提交于 2020-01-05 05:32:18
问题 I used the code below to login to my asp.net website. with framework 4 it's work successfully at web bowers, but didn't work on safari (iphone, ipad) only when I click on login button he refresh the page and not login. Session["AdminID"] = DT.Rows[0]["Id"].ToString(); Response.Cookies.Add(new HttpCookie("SuperAccountId", DT.Rows[0]["Id"].ToString())); Response.Cookies["SuperAccountId"].Expires = System.DateTime.Now.AddDays(1); Response.Cookies.Add(new HttpCookie("SuperAccountName", DT.Rows[0]

Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www)

别说谁变了你拦得住时间么 提交于 2020-01-05 04:28:09
问题 I have a custom members system that I have made: Yii2 Members System. You can refer to that for full details, or install it so you can work with it for this question. I have frontend and backend just as Yii2 provides, with a few modifications to separate the sessions/cookies so that backend works with the Admin model and pulls from an admin table. Similar to old traditional member systems. mainsite is basically a clone of frontend and it's role is to be the main website. What you get when you

PHP cannot read javascript cookies

六月ゝ 毕业季﹏ 提交于 2020-01-05 03:59:08
问题 I am setting a cookie with javascript and trying to read it with PHP, but php is not able to read it. I have checked that the cookie is really set with a tool called Cookies Manager. Code(JS): <script> document.cookie="encrIv=" + ivB64; </script> Code(PHP): <?php $encrIv = $_COOKIE['encrIv']; echo $encriv; ?> I get Notice : Undefined index: encrIv in C:\Users\joonas\Desktop\Webon cms\root\readCookie.php on line 1 Screen shot of cookie: 回答1: <!DOCTYPE html> <html> <head> <title>example</title>

JavaScript cookies not working on sub-domains

老子叫甜甜 提交于 2020-01-05 02:58:06
问题 I have a cookie authorization banner, with a button labeled 'Got it!' that dismisses it. I do that by setting a cookie. To set a cookie, I have this in my <head> : <script> function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays*24*60*60*1000)); var expires = "expires="+ d.toUTCString(); var domain = ".brokenhearts.ml"; var security = "secure"; var location = "/"; document.cookie = cname + "=" + cvalue + ";" + expires + ";" + location + ";" + domain + "

PHP Cookies not working

跟風遠走 提交于 2020-01-04 14:11:25
问题 I am building a website with logins. I have sessions working fine but I need to be able to keep them logged in if the click remember me. Currently I have the login script saving a cookie with the Username and Password they type to some cookies. I the below script $username and $password are set higher in the script. The $_SESSION variables are getting set fine. And I know the script is going into the if statement because before I place a alert box in there. login.php while($row = mysql_fetch

PHP Cookies not working

自闭症网瘾萝莉.ら 提交于 2020-01-04 14:11:15
问题 I am building a website with logins. I have sessions working fine but I need to be able to keep them logged in if the click remember me. Currently I have the login script saving a cookie with the Username and Password they type to some cookies. I the below script $username and $password are set higher in the script. The $_SESSION variables are getting set fine. And I know the script is going into the if statement because before I place a alert box in there. login.php while($row = mysql_fetch

Force-disabling cookies in Ruby on Rails 4 (European Union Legislation) until user (re-)accepts ToS

我只是一个虾纸丫 提交于 2020-01-04 13:31:29
问题 Since I am based in European Union, I believe all the websites I make have to comply with this stupid EU regulation that bans cookie use without user's informed consent (and require the user to opt-in). My intention is to go "full-overkill" and require user to (re-)accept Terms of Service whenever there's no "_#{app_name}_session" cookie sent from user and (re-)create it only after user clicks [ACCEPT] in said ToS. Basically, whenever someone visits the app, the user will be forced to

Use Golang to login to private site and pull info

早过忘川 提交于 2020-01-04 09:26:50
问题 I try to use golang to login in a private area of a website and pull some info, but i don't quite seem to get it right. I manage to fetch the login page to get the csrf token, then i post the csrf token together with the login info to the login page and i login just fine. If i stop at this point, i can see the page where i am redirected. However, any subsequent calls from this point on will redirect me back to login. The code package main import ( "github.com/PuerkitoBio/goquery" "io" _ "io