Jump to content

Search the Community

Showing results for tags 'session'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 58 results

  1. So, I was looking to implement the remember me for the login. I didnot find a module for that. The functionality will be some token saved on the user side, and on the first request make the user authenticate if he/she has the token with the request. So the question is what will be the first hook, which will be called, so I can implement the hook to add the implementation. Do you have any insights on the same?
  2. Hello, I'm wondering if this aproach is correct, had not been tested yet. What I'm trying to do is Log In an user from one browser and keep the user logged in a different browser. example: I have an app and send a login command to a processwire backend, the backend respons with the user id if the login was successful. http://example.com/login POST (encripted): username password response: 123 The code begin could be $username = $input->post('username'); $password = $input->post('password'); $user = $session->login($username, $password); if($user){ echo $user->id; } Then I read the User Id and open a new browser like this http://example.com/user/123 And the website checks if the user is logged in and opens a section only for logged in members. because PW saves the sessions in the server I think this could work. The code for this would be $userId = $input->urlSegment1; $user = $users->get($userId); if($user->isLoggedin()){ $session->redirect('/private/'); } else { $session->redirect('/'); } Thanks in advance
  3. Hi, I wanted to know if it is ok to change the session name in config.php from 'wire' to 'PHPSESSID'? i.e, from: $config->sessionName = 'wire'; to: $config->sessionName = 'PHPSESSID'; Are there any repercussions of doing this?
  4. Hi all, that's rather strange. It worked for some days but today it's broken and I don't know why. I'm implementing an user registration process where you have to pay some amount to earn a membership for a month. First you enter all your data (Street, Names, Username, Password...), this will be stored, and then you'll be directed to Paypal to pay the amount. Then a redirect happens to my page and a flag "payed" will be stored, too. To detect the right user, I created a $session->userdata = $input->post->getArray(); after the first post. This could be anything different, the point is: $session->userdata gets lost after the redirect from Paypal. It worked quite a while, but today it's broken. Is there a way to make $session permanent for, let's say, one day or so? Regards, Thomas
  5. Hello all, I hope everyone's having a nice weekend. For a project, I need to store some user information in session variables. Right now I'm storing that information to temp_*page_name* pages for every user. But I need to store this information only for 5 minutes, if user completes payment within that time, those stored variables are then moved to database in user's history. If user fails to complete payment before that, the session must be destroyed. I've no idea how to do this. I've read about $session in cheatsheet & PW's API documentation but no idea how exactly to do it. If someone can guide me a bit, that'd be great. All I need to know is how to use PHP's session timeout with PW's $session. Thanks in advance.
  6. Hello, maybe it's too late or I had too little coffee or something else is sitting on my brain but I can't figure this out. I want to build a hook that determines if the User Agent is a phone and set a session variable accordingly: $this->addHookBefore('Page::render', $this, 'checkMobile'); function checkMobile(HookEvent $event) { $page = $event->object; $session = wire('session'); $domain = preg_replace("/^(m\.)/",'',$_SERVER['HTTP_HOST']); # this is to force one version or the other: if(wire('input')->get->v == 'desktop') { $session->isMobile = 'no'; } if(wire('input')->get->v == 'mobile') { $session->isMobile = 'yes'; } # /force # here comes mobile detection via Mobile_Detect if(!$session->isMobile) { require(wire('config')->paths->root.'/Mobile_Detect.php'); $detect = new Mobile_Detect(); $session->isMobile = $detect->isMobile()?'yes':'no'; } # /mobile detection # now for the redirects. This is cosmetics but I would like it to work: if ($session->isMobile == "yes" && !preg_match("/\bm./", wire('config')->httpHost)) { wire("session")->redirect("//m.".$domain.$page->url); } if ($session->isMobile == "no" && preg_match("/\bm./", wire('config')->httpHost)) { $session->redirect("//".$domain.$page->url); } } The idea is, that if someone visits bmxrider.de on a mobile, he gets redirected to m.bmxrider.de and $session->isMobile is set to yes so I can change the templates later on. I also like to be able to force each version by setting $input->get->v Whenever I use the query string to "force" a state, my site ends up in endless redirects. I checked the logs and it looks like $session->isMobile toggles between yes and no and I have no idea, why this happens. Can someone help me out? Thanks, thomas Update: The eternal redirect happens, when the domain doesn't match the query string. Like m.bmxrider/?v=desktop or bmxrider/?v=mobile
  7. Hello all ! I'm using session to store some search parameters. It's ok on subpages but when I try to print session vars, there's something strange : __PHP_Incomplete_Class Object ( [__PHP_Incomplete_Class_Name] => WireInputData [stripSlashes:protected] => 0 [data:protected] => Array ( [cmbtype] => voiture [cmblargeur] => 7 [cmbhauteur] => 0 [cmbdiametre] => 10 [cmbcharge] => 0 [cmbvitesse] => 5 [cmbmanufacturer] => [price] => ) ) and on the other pages, everything seems to be correct : WireInputData Object ( [stripSlashes:protected] => 0 [data:protected] => Array ( [cmbtype] => voiture [cmblargeur] => 7 [cmbhauteur] => 0 [cmbdiametre] => 10 [cmbcharge] => 0 [cmbvitesse] => 5 [cmbmanufacturer] => [price] => ) ) Do you have an idea ? For information, I do not stock a value, but an array. Thank you !
  8. It would be great if there would be an easy way to add flash-type of session variables. Here is citation from codeigniter docs:
×
×
  • Create New...