My own session data not stored |
[eluser]Keem1[/eluser]
Hi, I've created (sorry, tried to create) a very simple login method for user login, now just store the session data, but not works. If you call the login method, your session data will store, but navigate other url in this website, the custom session data will lost. The code in login controller (not access to database yet), it's a plan: Code: function belepes() Help for hungarian words: - belepes() = login - kilepes() = logout - kivagyok() = who_am_i, checking the logged status My session configuration in config.php: Code: $config['sess_cookie_name'] = 'cisession'; My tests: - navigate to http://mysite/index.php/login/belepes/ to login - navigate to http://mysite/index.php/login/kivagyok/ to check data after navigating to other page While I'm logging in by calling the belepes() (login) method, the username will get back correctly (keem1). But I will navigate the next method, kivagyok() (who_am_i), all original session data (ip, user agent, and so on) return the correct value, but my own data, the username will return with empty. I've thought this is a very simple test without using database, but it seems, I have a very-very big mistake. What's wrong?
[eluser]TheFuzzy0ne[/eluser]
Are you sure that you're not calling the login function more than once? That would reset the session and explain your problem. |
Welcome Guest, Not a member yet? Register Sign In |