Welcome Guest, Not a member yet? Register   Sign In
Sessions & SimpleLoginSecure
#1

[eluser]zpjorge[/eluser]
I am developing a small web app that requires users to login, I am using SimpleLoginSecure to handle the login functionality.

I am auto-loading sessions which writes a session cookie as soon as the site is loaded, but I really don't need sessions/cookies loaded until the user logs in. The client has communicated to me that they do NOT want cookies stored when you visit the homepage, only when a user logs in.

Here is where I need help

How can I disable the system from writing cookies when the site is loaded and only write them when they login?
#2

[eluser]Jelmer[/eluser]
Put the set_cookie function in a statement like:
Code:
if($this->session->userdata('logged_in')){
    // put your cookie code here
}
#3

[eluser]zpjorge[/eluser]
[quote author="Jelmer" date="1228786838"]Put the set_cookie function in a statement like:
Code:
if($this->session->userdata('logged_in')){
    // put your cookie code here
}
[/quote]

Close, but no.

What I ended up doing is extending the session library and removing the default session_write function that writes a cookie. So what this does is A. don't write the default cookie when a user hits the homepage B. Only write the cookie when the user logs in.




Theme © iAndrew 2016 - Forum software by © MyBB