Welcome Guest, Not a member yet? Register   Sign In
Refresh & no expiration cookie
#1

[eluser]ilpega[/eluser]
Hello all!
I have created a codeigniter + bootstrap + ion auth web app. Now I have to show a part of this web app into a monitor. The page shown is refreshed every 2 minutes. However to view this page I have to enter username and password.
How can I update the session cookie so that it never expires?
There are other methods?

Thanks for your help!!!
#2

[eluser]RaGe10940[/eluser]
'sess_expiration' = the number of SECONDS you want the session to last. By default sessions last 7200 seconds (two hours). Set to zero for no expiration.

I think this is what you are asking, if so then RT[F]M - lol
#3

[eluser]ilpega[/eluser]
Thank you for your reply.

Is it possible to set sess_expiration to 0 only for a selected user???
#4

[eluser]RaGe10940[/eluser]
In CI I don't know. In normal php without CI then yes
#5

[eluser]ilpega[/eluser]
uhm how in normal php?
#6

[eluser]RaGe10940[/eluser]
You do a check on the user name the user provided like so :

Code:
if($_POST['user'] === 'John') {
// Don't expire his session
} else {
// Expire the session like you would for every one else.
}
#7

[eluser]TheFuzzy0ne[/eluser]
You could extend the Session class if you wanted to.

You could also just make sure you set the expiration time before the cookie is updated:
Code:
$this->session->sess_expiration = $sess_expiration;

If you don't do it before you cookie is updated, you'll probably have to call $this->session->sess_write() straight after.
#8

[eluser]ilpega[/eluser]
Thank you all, I try!




Theme © iAndrew 2016 - Forum software by © MyBB