set cooke in php in login user

Advertisements I made a site with PHP that the user enters I wanted to do something with cookies in PHP so that when the user enters another header is displayed <?php include "database/pdo_connection.php"; $error=""; $errorFild=""; if( isset($_POST[‘phone’]) && $_POST[‘phone’] !== ” && isset($_POST[‘password’]) && $_POST[‘password’] !== ” ) { if(isset($_POST[‘sub’])){ $phone=$_POST[‘phone’]; $password=$_POST[‘password’]; $smt=$conn->prepare("SELECT `password` FROM… Read More set cooke in php in login user

Express JS set a cookie doesn't work when using res.json

Advertisements I have a login route where I want to set a cookie after I verify the login credentials. The client and the server are on different ports. const app = express(); app.use( cors({ credentials: true, origin: true, }) ); app.use(cookieParser()); app.use(‘/login’, (req, res) => { res.cookie(‘secureCookie’, JSON.stringify({ id: 1 }), { secure: false, httpOnly:… Read More Express JS set a cookie doesn't work when using res.json

When cookie has some values, it cannot be read back

Advertisements When I save a cookie with the following value, it works fine: TransloadingInventoryFilter=Product:2 When I save a cookie with the following value, it works fine: TransloadingInventoryFilter=ProductCategory:1::Product:2 But when I save a cookie with the following value, it doesn’t work: TransloadingInventoryFilter=Consignee:HALLIBURTON ENERGY SERVICES::ProductCategory:1::Product:2 My browser correctly shows this as the cookie value. But when my… Read More When cookie has some values, it cannot be read back

I have this error System.ServiceModel.Security.MessageSecurityException

Advertisements For what I read and understood, this happens when I’m not sending the authentication. But I tried to send it in two ways: string userN = "username"; string _pasw = "password"; BasicHttpBinding binding = new BasicHttpBinding(); Endpoint wsdl = new Endpoint("MyEndpoint"); SoapClient client = new SoapClient(binding, wsdl); client.ClientCredentials.UserName.UserName = userN; client.ClientCredentials.UserName.Password = _pasw; await… Read More I have this error System.ServiceModel.Security.MessageSecurityException

NodeJS: Cookie is undefined

Advertisements I’m trying to make a simple GET request to my localhost:8080. When I make the GET request with Postman, I set a simple cookie. Now, in the main file, I’ve: var express = require(‘express’); var app = express(); const cookieParser = require(‘cookie-parser’); app.use(cookieParser()); const app_router = require(‘./routes/router’); app.use("/api", app_router); app.use(express.static(‘public’)); app.listen(8080, function () {… Read More NodeJS: Cookie is undefined

How can I store a 2-dimensional array into cookies?

Advertisements I’m trying to save my states into the cookies using the react-cookie package. It’s ok when I want to store some strings into the cookie but my problem is when it comes to saving arrays. For example, I have an array with the below structure: const arr = [ [‘correct’,’correct’,’absent’], [‘present’,’correct’,’present’], [‘absent’,’absent’,’correct’] ] And… Read More How can I store a 2-dimensional array into cookies?