Questions tagged as 'session'

1
answer

Incorrect Redirection

I'm trying to redirect registered users to the control panel and other visitors to the login page, but I get this message: Login<?php$page="Login"; include "header.php"; $user_error=''; $pass_error=''; if(isset($_POST["login"])){ $usern...
asked by 24.05.2014 / 00:56
1
answer

Laravel array session overwriting

I'm trying to write product data to a session in Laravel , but it overwrites the session. I have an array of products in the view: @foreach($products as $product) <form action="{{ url('/cart/add') }}/{{ $product->id }}" method=...
asked by 07.11.2018 / 17:01
1
answer

Make a session expire

I'm trying to put on my page that if the visitor stays 20min inactive, the session expires, php destroys the session and redirects the visitor to the login page. But it's not working. My code looks like this: session_start(); $_SESSION['inicio...
asked by 16.11.2018 / 23:31
1
answer

How do I update a column once per page viewed?

I'm trying to create a hit counter, this code updates my column once per session, but what I want is to update my column whenever the user views a new page. if(!isset($_SESSION))session_start(); if(empty($_SESSION['counter'])){ $_SESSION[...
asked by 05.10.2018 / 03:07
1
answer

How to save the user session to a site stored in AWS - S3?

At AWS we can use the S3 service to provide static web sites. Seundo at documentation stands for static not using backend like php, asp.net, etc. However, I can dynamically load content through javascript get requests, consuming end-points...
asked by 23.08.2018 / 05:11
1
answer

Logged-in user can login to their login page

When the user logs in he creates sessions and goes to the panel, but he continues with access to the login page. how to send it back to the panel.php when it tries to go to the login page? sessions: $user = $_POST['usuario']; $_SESSION['use...
asked by 01.08.2018 / 02:58
1
answer

$ _SESSION of PHP is not recognized in the same server in different URL

I have a verifica.php file that checks if the user session was started after login, what happens is this: There are two URL's: link And inside it has a link that leads to another URL: link At the beginning of each page you eve...
asked by 29.05.2018 / 15:51
1
answer

Multiple keys in the session

I would like to save and retrieve an array type session in Laravel type in PHP Example : PHP : $_SESSION['dado']['dado1'] = $valor; Recovering echo $_SESSION['dado']['dado1']; Laravel $request->session()->put(...
asked by 25.05.2018 / 19:22
1
answer

Use data from a $ _SESSION in Javascript?

Talk to everyone, okay? I'm catching up with something that I believe should be something simple. I have this little function in javascript where according to the user level I should send to different pages. Example, if the session user is...
asked by 02.11.2017 / 17:39
1
answer

Associate logged in user with your information?

After doing the "session", how do I bring the user information logged in? I know it's not just creating a session, I need to bring user information like Name / Nickname, avatar, email etc.     
asked by 23.08.2017 / 19:51