CodeIgniter Forums
Authorization+mobile - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Authorization+mobile (/showthread.php?tid=8038)

Pages: 1 2


Authorization+mobile - El Forum - 05-02-2008

[eluser]luukskywalker[/eluser]
Hello everybody,

I have succesfully build an application with Codeigniter.
Big thank you to the developers because this framework is really really good.

But i have a small problem.

i want to create a mobile version of my application(small version with only a little bit of functionality).
But i want to make it as secure as possible.

I tried opening my current application on a mobile device but i can't seem to log in.

This is what i did:

- User types in username and password.
- System checks in the database if user exists and if the password matches the password field.
-If so:
Code:
$sessiondata = array(
'userid'  => $userid,
'name'    => $name,
'email'   => $email,                    
'logged_in' => true);
$this->session->set_userdata($sessiedata);
etc.(i use the userid and email a lot during my application.)

-During the application the system checks when calling a function if logged in = true like this:
Code:
$login = $this->session->userdata('logged_in');
        if($login==true){
                //Do stuff
                 }else{
                 //Send back to login screen and give error message: "Not logged in"
                }

Plain and simple.
But if i login on a mobile system, after pressing the submit button, i get the error message not logged in.

Can someone tell me what my problem is?
I hope its clear explained this way.
Thanks in advance!

Luukskywalker


Authorization+mobile - El Forum - 05-02-2008

[eluser]v33s[/eluser]
Hmm.. AFAIK mobile phones does not support session handler !?


Authorization+mobile - El Forum - 05-02-2008

[eluser]luukskywalker[/eluser]
hmmm
I didn't know that.

Than i got to find another way to secure my mobile application


Authorization+mobile - El Forum - 05-03-2008

[eluser]luukskywalker[/eluser]
I just found out that sessions do work on a mobile phone.

Sessions are handled by the server and not by the client so it doesnt matter wich client you use.


Authorization+mobile - El Forum - 05-03-2008

[eluser]Jameson.[/eluser]
Well, it actually DOES matter. You need a client that supports cookies, not all mobile software does that (correctly).


Authorization+mobile - El Forum - 05-03-2008

[eluser]luukskywalker[/eluser]
allright i'll keep that in mind!


Authorization+mobile - El Forum - 05-03-2008

[eluser]Hermawan Haryanto[/eluser]
Did I miss read something?
Quote:$login = ...
then on the next line ..
Quote:if($inlog==true){

I'm sure $inlog will always be false coz it never been dimmed.

Curse Me If I'm Wrong
Hermawan Haryanto


Authorization+mobile - El Forum - 05-03-2008

[eluser]luukskywalker[/eluser]
There's nothing wrong with the code.


Authorization+mobile - El Forum - 05-03-2008

[eluser]Hermawan Haryanto[/eluser]
I don't think $login will be equal to $inlog, or..?


Authorization+mobile - El Forum - 05-03-2008

[eluser]luukskywalker[/eluser]
yeah it is
i kinda forgot to change it with the translation to englishSmile
I changed it so it is a bit more clear for all readersSmile