Jump to content

urlSegment ist set to "assets" if empty


cpx3
 Share

Recommended Posts

Hello!

When I try to get an urlSegment of a page that has no urlSegment (i.e. www.domain.com/ ) the value is always changed to "assets". When trying to receive urlSegment2 (that also does not exist) I get the filename of an image. Any idea what I am doing wrong?

Thanks in advance,

Bernhard

Link to comment
Share on other sites

wbmnfktr, thanks for your answer! Actually I have not a general problem with urlSegments, they work. When using urlSegment1 on www.domain.com/seg1/seg2 it works fine. The problem appears when I save this urlSegment1 to a session and then call a page www.domain.com/ with NO urlSegment, the session value is changed to "assets" even I tell PW to change the session value only if strlen($input->urlSegment1)>0. This only happens when I want PW to leave the session value alone... It must have to do with urlSegments (#3 for example gave me the path of an image file) as the problem does not occur with any other value. 

Link to comment
Share on other sites

Oh... ok... I never use anything with sessions as they don't work with ProCache (or at least not for me), which is almost always present in my projects.

Do you have any caching in place?
Maybe that's the reason it doesn't work.

But for now... no... sorry. No clue why it doesn't work out in sessions.

  • Like 1
Link to comment
Share on other sites

I don't use them at all.
No need at all, after deciding ProCache's benefits have more weight.

And... I really never had the need or a real reason to use sessions - besides user/member pages - but in those cases my setup looks different right from the start and even those don't use sessions.
In case I need something like that, I most often use cookies or local storage. Still I can count all those scenarios on 5 fingers.

What's your setup or goal for your setup/project?
Why do you need those sessions?
In case for search or a limited part of your sites... think about disabling ProCache for those pages.

  • Like 1
Link to comment
Share on other sites

I do not use ProCache in this project but in another, so is good to know that it might cause troubles (I never read about that). I need sessions for navigation as I do not want urlSegments on the startpage and I need to know which in which „area“ of the page the user is (the menu depends on that). Any other idea?

Link to comment
Share on other sites

@flydev Merci beaucoup (also for your wonderful modul!) Eventually I found the problem: it was a missing trailing slash in the url segment, although the setting was to either / or. Thanks to all of you for the support!

 

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...