Jump to content

Search the Community

Showing results for tags 'Session'.

  • 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

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

  1. I didn't have time to look into the code, so I have to ask here: is there a limit for the password length? I'm using LastPass and wherever it's possible I use ridiculously long passwords. And so I did in PW for an admin password. After a logout I couldn't log in again. I managed to do that only after setting the pass to something shorter than 50-chars. I see no reason why the passwords could have been limited (as they're hashed anyway), so that totally might be something on my end (or LastPass). But, just in case, I thought it's worth mentioning here as a potential issue.
  2. Hi guys, Is there any reason why $session variables shouldn't get updated when using jQuery $.post? For some reason, no matter how trivial the example I use, data received from $.post which is successfully updating pages is failing to set $session variables. Am properly in "banging head against wall territory" now
  3. Hi all I have built my own module for processing forms on my site. The module does check to see of the request was forged or not, but I am unable to inset the token name and value into my template. I use Twig for my templates, and this is what I'm calling: <form data-form-ident="contact-form" data-form-token-name="{{ this.session.CSRF.getTokenName() }}" data-form-token-value="{{ this.session.CSRF.getTokenValue() }}"> The output for that is an empty string. Could it perhaps be because I am using Twig? Side note: disabling Twig is not an option as the templates I'm using are very complex - it would be a darn mission to revert to native PHP. (PW 2.4.0)
  4. 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?
  5. 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
  6. 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?
  7. 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
  8. 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.
  9. 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
  10. 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 !
  11. 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...