Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 06:31:23 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155547 Posts in 21714 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Auto login user from cookie in frontend  (Read 493 times)
Monky
Development Team
*****
Offline Offline

Posts: 47



WWW
« on: June 19, 2011, 12:40:55 PM »

Hello forum,
what I'd like to achieve is the following:
When a user visits my WB page, the template should check for WBs login cookie and - if it exists - automatically log in the user.

This functionality is already included in WB in the admin backend. When I visit my homepage on the URL .../admin/ I automatically access the admin backend without entering my username/password (of course the "smart login" and "remember me" options are enabled and the user has to have a valid cookie).

Since I don't want to mess with the (security relevant) login code I ask here first Smiley Has anyone accomplished this behaviour for WB?

Since auto login already works in the SESSION one idea of me was to "copy" the cookie settings (if present) into the SESSION. Might this work?

Regards,
Sebastian
Logged
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2297



WWW
« Reply #1 on: June 19, 2011, 10:02:19 PM »

You're right, you should not mess with the login code.

But copying the checks from the login class and make your own functionality in your template should not be that difficult.
(look for: is_remembered() )
Logged

Professional WebsiteBaker Solutions
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!